* [U-Boot] [PATCH] NAND: add more watchdog resets
@ 2011-02-03 0:23 Scott Wood
2011-02-03 9:36 ` Jaap de Jong
0 siblings, 1 reply; 2+ messages in thread
From: Scott Wood @ 2011-02-03 0:23 UTC (permalink / raw)
To: u-boot
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>
---
Jaap, does this resolve the watchdog problems you were seeing?
drivers/mtd/nand/nand_base.c | 6 ++++++
drivers/mtd/nand/nand_util.c | 2 ++
2 files changed, 8 insertions(+), 0 deletions(-)
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 @@ static int nand_do_read_ops(struct mtd_info *mtd, loff_t from,
oob = ops->oobbuf;
while(1) {
+ WATCHDOG_RESET();
+
bytes = min(mtd->writesize - col, readlen);
aligned = (bytes == mtd->writesize);
@@ -1485,6 +1487,7 @@ static int nand_do_read_oob(struct mtd_info *mtd, loff_t from,
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 @@ static int nand_do_write_ops(struct mtd_info *mtd, loff_t to,
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 @@ int nand_erase_nand(struct mtd_info *mtd, struct erase_info *instr,
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 @@ int nand_write_skip_bad(nand_info_t *nand, loff_t offset, size_t *length,
pages = write_size / pagesize_oob;
for (page = 0; page < pages; page++) {
+ WATCHDOG_RESET();
+
ops.datbuf = p_buffer;
ops.oobbuf = ops.datbuf + pagesize;
--
1.7.1
^ permalink raw reply related [flat|nested] 2+ messages in thread* [U-Boot] [PATCH] NAND: add more watchdog resets
2011-02-03 0:23 [U-Boot] [PATCH] NAND: add more watchdog resets Scott Wood
@ 2011-02-03 9:36 ` Jaap de Jong
0 siblings, 0 replies; 2+ messages in thread
From: Jaap de Jong @ 2011-02-03 9:36 UTC (permalink / raw)
To: u-boot
My testresults:
unpatched ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
nand read 0x20000000 0x00100000 0x03000000
no problem
nand write 0x20000000 0x00100000 0x00c00000
no problem
nand write 0x20000000 0x00100000 0x00d00000
the watchdog will reset the processor
patched ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
nand read 0x20000000 0x00100000 0x03000000
no problem
nand write 0x20000000 0x00100000 0x07f00000
no problem
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
So, reading was never a problem, only writing.
And that is fixed now!
Thanks!
On 02/03/2011 01:23 AM, Scott Wood wrote:
> 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>
> ---
> Jaap, does this resolve the watchdog problems you were seeing?
>
> drivers/mtd/nand/nand_base.c | 6 ++++++
> drivers/mtd/nand/nand_util.c | 2 ++
> 2 files changed, 8 insertions(+), 0 deletions(-)
>
> 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 @@ static int nand_do_read_ops(struct mtd_info *mtd, loff_t from,
> oob = ops->oobbuf;
>
> while(1) {
> + WATCHDOG_RESET();
> +
> bytes = min(mtd->writesize - col, readlen);
> aligned = (bytes == mtd->writesize);
>
> @@ -1485,6 +1487,7 @@ static int nand_do_read_oob(struct mtd_info *mtd, loff_t from,
> 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 @@ static int nand_do_write_ops(struct mtd_info *mtd, loff_t to,
> 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 @@ int nand_erase_nand(struct mtd_info *mtd, struct erase_info *instr,
> 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 @@ int nand_write_skip_bad(nand_info_t *nand, loff_t offset, size_t *length,
>
> pages = write_size / pagesize_oob;
> for (page = 0; page< pages; page++) {
> + WATCHDOG_RESET();
> +
> ops.datbuf = p_buffer;
> ops.oobbuf = ops.datbuf + pagesize;
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-02-03 9:36 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-02-03 0:23 [U-Boot] [PATCH] NAND: add more watchdog resets Scott Wood
2011-02-03 9:36 ` Jaap de Jong
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox