From: Patrice Chotard Date: Wed, 20 Jan 2021 13:42:04 +0000 (+0100) Subject: mtd: spinand: Add WATCHDOG_RESET() in spinand_mtd_read/write() X-Git-Url: http://git.dujemihanovic.xyz/login.html?a=commitdiff_plain;h=de6f70a6329ebf3845fa9173dbd7962a15802c05;p=u-boot.git mtd: spinand: Add WATCHDOG_RESET() in spinand_mtd_read/write() In case of big area read/write on spi nand, watchdog timeout may occurs. To fix that, add WATCHDOG_RESET() in spinand_mtd_read() and spinand_mtd_write() to ensure that watchdog is reset. Signed-off-by: Patrice Chotard Reviewed-by: Patrick Delaunay --- diff --git a/drivers/mtd/nand/spi/core.c b/drivers/mtd/nand/spi/core.c index 68ef5d1af8..e5330958c7 100644 --- a/drivers/mtd/nand/spi/core.c +++ b/drivers/mtd/nand/spi/core.c @@ -22,6 +22,7 @@ #else #include #include +#include #include #include #include @@ -578,6 +579,7 @@ static int spinand_mtd_read(struct mtd_info *mtd, loff_t from, #endif nanddev_io_for_each_page(nand, from, ops, &iter) { + WATCHDOG_RESET(); ret = spinand_select_target(spinand, iter.req.pos.target); if (ret) break; @@ -629,6 +631,7 @@ static int spinand_mtd_write(struct mtd_info *mtd, loff_t to, #endif nanddev_io_for_each_page(nand, to, ops, &iter) { + WATCHDOG_RESET(); ret = spinand_select_target(spinand, iter.req.pos.target); if (ret) break;