diff options
author | Shawn Nematbakhsh <shawnn@chromium.org> | 2016-03-02 14:09:11 -0800 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2016-03-02 20:26:28 -0800 |
commit | 2843987640aabb72ae33e0f82aecfccdc25f0919 (patch) | |
tree | 275fc91a0a47688be32c752a74a9c3daa9f2f965 /common/spi_flash.c | |
parent | faa870945e5614fcc02c1e63459b93198a49fbd2 (diff) | |
download | chrome-ec-2843987640aabb72ae33e0f82aecfccdc25f0919.tar.gz |
spi_flash: Reload watchdog after erasing each 32K block
A single erase host command may erase an arbitrarily large region of
storage, which may lead to our watchdog firing.
BUG=chrome-os-partner:50587
BRANCH=glados
TEST=Manual on glados, flash RW EC / PD FW while plugging + unplugging
zinger. Verify that watchdog doesn't fire.
Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org>
Change-Id: I90dc85306aec43326c11c794861f68c6e12686e4
Reviewed-on: https://chromium-review.googlesource.com/329987
Commit-Ready: Shawn N <shawnn@chromium.org>
Tested-by: Shawn N <shawnn@chromium.org>
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Diffstat (limited to 'common/spi_flash.c')
-rw-r--r-- | common/spi_flash.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/common/spi_flash.c b/common/spi_flash.c index 0b73df132e..41138c5362 100644 --- a/common/spi_flash.c +++ b/common/spi_flash.c @@ -230,6 +230,11 @@ int spi_flash_erase(unsigned int offset, unsigned int bytes) bytes -= 32 * 1024; offset += 32 * 1024; + /* + * Refresh watchdog since we may be erasing a large + * number of blocks. + */ + watchdog_reload(); } } |