NAND: add more watchdog resets
Poke the watchdog in a variety of looping constructs, which could take
a long time to complete.
Signed-off-by: Scott Wood <scottwood@freescale.com>
diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
index 70c0593..b9bd394 100644
--- a/drivers/mtd/nand/nand_base.c
+++ b/drivers/mtd/nand/nand_base.c
@@ -1156,6 +1156,8 @@
oob = ops->oobbuf;
while(1) {
+ WATCHDOG_RESET();
+
bytes = min(mtd->writesize - col, readlen);
aligned = (bytes == mtd->writesize);
@@ -1485,6 +1487,7 @@
page = realpage & chip->pagemask;
while(1) {
+ WATCHDOG_RESET();
sndcmd = chip->ecc.read_oob(mtd, chip, page, sndcmd);
len = min(len, readlen);
@@ -1884,6 +1887,8 @@
memset(chip->oob_poi, 0xff, mtd->oobsize);
while(1) {
+ WATCHDOG_RESET();
+
int bytes = mtd->writesize;
int cached = writelen > bytes && page != blockmask;
uint8_t *wbuf = buf;
@@ -2215,6 +2220,7 @@
instr->state = MTD_ERASING;
while (len) {
+ WATCHDOG_RESET();
/*
* heck if we have a bad block, we do not erase bad blocks !
*/
diff --git a/drivers/mtd/nand/nand_util.c b/drivers/mtd/nand/nand_util.c
index 8b4f738..5a6f7ae 100644
--- a/drivers/mtd/nand/nand_util.c
+++ b/drivers/mtd/nand/nand_util.c
@@ -542,6 +542,8 @@
pages = write_size / pagesize_oob;
for (page = 0; page < pages; page++) {
+ WATCHDOG_RESET();
+
ops.datbuf = p_buffer;
ops.oobbuf = ops.datbuf + pagesize;