diff options
author | Vadim Bendebury <vbendeb@chromium.org> | 2019-08-21 14:26:31 -0700 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2019-08-23 23:50:07 +0000 |
commit | 481da547186bc9989068ceef73ccd1556a911dad (patch) | |
tree | aac2de2f325752c2860e5a1e62f8a71e7445b8d8 /include/flash_log.h | |
parent | fe402aec3c8014e16828fee2bfa921eeffbc39fe (diff) | |
download | chrome-ec-481da547186bc9989068ceef73ccd1556a911dad.tar.gz |
nvmem: recover from failure saving object spanning flash pages
In case power was lost when saving an object spanning two pages, the
initialization process does not return the second flash page into the
pages pool, leaving NVMEM in an inconsistent state.
Proper recovery should reinitialize the second page and return it into
the pool of available flash pages.
If a failure like this happens, to recover the initialization sequence
will have to run one extra cycle, first one bringing the NVMEM state
to the previously covered state of the last object in NVMEM corrupted,
but fitting into a page.
A unit test added to verify proper behavior in this situation.
BRANCH=cr50, cr50-mp
BUG=b:139326267
TEST='make run-nvmem -j' passes. Also added temporary code cause reset
when saving the second part of an object spanning two flash
pages. Observed the device properly recover from this failure.
Change-Id: I76ebb6fc73ffc0b07bce34370302f3787914bfb2
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1766092
Reviewed-by: Andrey Pronin <apronin@chromium.org>
Diffstat (limited to 'include/flash_log.h')
-rw-r--r-- | include/flash_log.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/include/flash_log.h b/include/flash_log.h index bb4baf651c..64ee2703e3 100644 --- a/include/flash_log.h +++ b/include/flash_log.h @@ -64,7 +64,8 @@ enum nvmem_failure_type { NVMEMF_SECTION_VERIFY = 9, NVMEMF_PRE_ERASE_MISMATCH = 10, NVMEMF_PAGE_LIST_OVERFLOW = 11, - NVMEMF_CIPHER_ERROR = 12 + NVMEMF_CIPHER_ERROR = 12, + NVMEMF_CORRUPTED_INIT = 13 }; /* Not all nvmem failures require payload. */ |