diff options
author | Vadim Bendebury <vbendeb@chromium.org> | 2019-09-19 12:29:20 -0700 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2019-09-27 11:20:02 +0000 |
commit | 5c8e3ab65063a5a62dabdf2a228e3fb538e3a2e9 (patch) | |
tree | a7f70045813a9088ba0131ff3a6e6808a52cb0fd /chip/g | |
parent | 49efdd8a8eaed593beeb8686e40d343f38e82a62 (diff) | |
download | chrome-ec-5c8e3ab65063a5a62dabdf2a228e3fb538e3a2e9.tar.gz |
g: avoid locked up flash after denied operation
It looks like the flash controller requires the user to explicitly
clear the command field if the command fails. Not clearing the command
field prevents error status from clearing on read.
BRANCH=cr50, cr50-mp
BUG=b:141203977
TEST=with the latest RO locking out INFO1 erases, it is possible to
keep accessing flash after failing 'eraseflashinfo' invocation:
> eraseflashinfo
do_flash_op:274 errors 1000 fsh_pe_control 40720004
do_flash_op:265
Failed to erase info space!
Unknown error
Usage: eraseflashinfo
> bid
Board ID: 0001e240, flags 00000000
>
Change-Id: I4dd14e1e5f974bb30e2ca5beb9e43e2974ace179
Signed-off-by: Marius Schilder <mschilder@chromium.org>
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1812175
Reviewed-by: Mary Ruthven <mruthven@chromium.org>
Diffstat (limited to 'chip/g')
-rw-r--r-- | chip/g/flash.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/chip/g/flash.c b/chip/g/flash.c index 28c97875f4..fbf1af83a7 100644 --- a/chip/g/flash.c +++ b/chip/g/flash.c @@ -260,6 +260,8 @@ static int do_flash_op(enum flash_op op, int is_info_bank, /* Timed out waiting for control register to clear */ if (tmp) { + /* Stop the failed operation. */ + *fsh_pe_control = 0; CPRINTF("%s:%d\n", __func__, __LINE__); return EC_ERROR_UNKNOWN; } |