aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrice Chotard <patrice.chotard@foss.st.com>2021-01-20 14:42:04 +0100
committerPatrice Chotard <patrice.chotard@foss.st.com>2021-03-11 17:00:41 +0100
commitde6f70a6329ebf3845fa9173dbd7962a15802c05 (patch)
tree2c01b5cf42d7e50c7d416de77be2048f2950252a
parent3f6cfdaa23763b691345d2d3709fe1668291f407 (diff)
downloadu-boot-de6f70a6329ebf3845fa9173dbd7962a15802c05.zip
u-boot-de6f70a6329ebf3845fa9173dbd7962a15802c05.tar.gz
u-boot-de6f70a6329ebf3845fa9173dbd7962a15802c05.tar.bz2
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 <patrice.chotard@foss.st.com> Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
-rw-r--r--drivers/mtd/nand/spi/core.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/mtd/nand/spi/core.c b/drivers/mtd/nand/spi/core.c
index 68ef5d1..e533095 100644
--- a/drivers/mtd/nand/spi/core.c
+++ b/drivers/mtd/nand/spi/core.c
@@ -22,6 +22,7 @@
#else
#include <common.h>
#include <errno.h>
+#include <watchdog.h>
#include <spi.h>
#include <spi-mem.h>
#include <dm/device_compat.h>
@@ -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;