]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
mtd: nand: Add WATCHDOG_RESET() in nanddev_mtd_erase()
authorPatrice Chotard <patrice.chotard@foss.st.com>
Wed, 20 Jan 2021 13:42:03 +0000 (14:42 +0100)
committerPatrice Chotard <patrice.chotard@foss.st.com>
Thu, 11 Mar 2021 15:59:16 +0000 (16:59 +0100)
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>
drivers/mtd/nand/core.c

index 219efdc8959a365b5ff423fa33cb45f20e926231..090834a495facf119b1b66cf5008c549dd323762 100644 (file)
@@ -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);