From 2843987640aabb72ae33e0f82aecfccdc25f0919 Mon Sep 17 00:00:00 2001 From: Shawn Nematbakhsh Date: Wed, 2 Mar 2016 14:09:11 -0800 Subject: [PATCH] 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 Change-Id: I90dc85306aec43326c11c794861f68c6e12686e4 Reviewed-on: https://chromium-review.googlesource.com/329987 Commit-Ready: Shawn N Tested-by: Shawn N Reviewed-by: Vincent Palatin --- common/spi_flash.c | 5 +++++ 1 file changed, 5 insertions(+) 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(); } }