From a388377c7699bcbca57bb495a0e55ea7543b394d Mon Sep 17 00:00:00 2001 From: Dino Li Date: Wed, 11 Aug 2021 15:42:03 +0800 Subject: zephyr: asurada: reload watchdog on each flash write If AP sends write flash command continuously, EC might not have chance to go back to hook task to touch watchdog. Reload watchdog on each flash write to prevent the reset. BRANCH=none BUG=b:195954913 TEST=no watchdog reset during software sync. Signed-off-by: Dino Li Change-Id: I27bf921f1162f6d91b97918162c938985933f432 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3088972 Reviewed-by: Denis Brockus Reviewed-by: Keith Short --- zephyr/drivers/cros_flash/cros_flash_it8xxx2.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/zephyr/drivers/cros_flash/cros_flash_it8xxx2.c b/zephyr/drivers/cros_flash/cros_flash_it8xxx2.c index 3cacca13cc..f238b1557b 100644 --- a/zephyr/drivers/cros_flash/cros_flash_it8xxx2.c +++ b/zephyr/drivers/cros_flash/cros_flash_it8xxx2.c @@ -178,6 +178,14 @@ static int cros_flash_it8xxx2_write(const struct device *dev, int offset, return -EACCES; } + /* + * If AP sends write flash command continuously, EC might not have + * chance to go back to hook task to touch watchdog. Reload watchdog + * on each flash write to prevent the reset. + */ + if (IS_ENABLED(CONFIG_PLATFORM_EC_WATCHDOG)) + watchdog_reload(); + return flash_write(flash_controller, offset, src_data, size); } -- cgit v1.2.1