aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrice Chotard <patrice.chotard@foss.st.com>2021-01-20 14:42:03 +0100
committerPatrice Chotard <patrice.chotard@foss.st.com>2021-03-11 16:59:16 +0100
commit3f6cfdaa23763b691345d2d3709fe1668291f407 (patch)
tree3c14cbf7abb11b4558e9c4151eefb262be0c2bf2
parente48ec51b43ed0c9a4eb767addb829cef418041c7 (diff)
downloadu-boot-3f6cfdaa23763b691345d2d3709fe1668291f407.zip
u-boot-3f6cfdaa23763b691345d2d3709fe1668291f407.tar.gz
u-boot-3f6cfdaa23763b691345d2d3709fe1668291f407.tar.bz2
mtd: nand: Add WATCHDOG_RESET() in nanddev_mtd_erase()
In case of big area erased on nand, watchdog timeout may occurs. To fix that, add WATCHDOG_RESET() in nanddev_mtd_erase() 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/core.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/mtd/nand/core.c b/drivers/mtd/nand/core.c
index 219efdc..090834a 100644
--- a/drivers/mtd/nand/core.c
+++ b/drivers/mtd/nand/core.c
@@ -10,6 +10,7 @@
#define pr_fmt(fmt) "nand: " fmt
#include <common.h>
+#include <watchdog.h>
#ifndef __UBOOT__
#include <linux/compat.h>
#include <linux/module.h>
@@ -172,6 +173,7 @@ int nanddev_mtd_erase(struct mtd_info *mtd, struct erase_info *einfo)
nanddev_offs_to_pos(nand, einfo->addr, &pos);
nanddev_offs_to_pos(nand, einfo->addr + einfo->len - 1, &last);
while (nanddev_pos_cmp(&pos, &last) <= 0) {
+ WATCHDOG_RESET();
ret = nanddev_erase(nand, &pos);
if (ret) {
einfo->fail_addr = nanddev_pos_to_offs(nand, &pos);