From patchwork Mon Mar 16 20:18:32 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rasmus Villemoes X-Patchwork-Id: 243711 List-Id: U-Boot discussion From: rasmus.villemoes at prevas.dk (Rasmus Villemoes) Date: Mon, 16 Mar 2020 21:18:32 +0100 Subject: [PATCH] mtd: spi-nor-core: call WATCHDOG_RESET() in spi_nor_ready() Message-ID: <20200316201832.28693-1-rasmus.villemoes@prevas.dk> I have a board for which doing "sf erase 0x100000 0x80000" consistently causes the external watchdog circuit to reset the board. Make sure to pet the watchdog during slow operations such as erasing or writing large areas of a spi nor flash. Signed-off-by: Rasmus Villemoes --- drivers/mtd/spi/spi-nor-core.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/mtd/spi/spi-nor-core.c b/drivers/mtd/spi/spi-nor-core.c index 4076646225..b7f7aa7b28 100644 --- a/drivers/mtd/spi/spi-nor-core.c +++ b/drivers/mtd/spi/spi-nor-core.c @@ -20,6 +20,7 @@ #include #include #include +#include #include "sf_internal.h" @@ -399,6 +400,7 @@ static int spi_nor_ready(struct spi_nor *nor) { int sr, fsr; + WATCHDOG_RESET(); sr = spi_nor_sr_ready(nor); if (sr < 0) return sr;