public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] Possible bug in NAND driver
@ 2009-07-13 19:34 Paulraj, Sandeep
  2009-07-14  9:03 ` Valeriy Glushkov
  2009-07-16 17:46 ` [U-Boot] Possible bug in NAND driver Scott Wood
  0 siblings, 2 replies; 6+ messages in thread
From: Paulraj, Sandeep @ 2009-07-13 19:34 UTC (permalink / raw)
  To: u-boot


If we refer to the following code snippet from nand_util.c

rval = nand_read (nand, offset, &read_length, p_buffer);

                if (rval != 0) {

                          printf ("NAND read from offset %llx failed %d\n",

                                  offset, rval);

                         *length -= left_to_read;

                          return rval;

                  }


The above code will return failure even after ECC errors are corrected.

This is because of the following line of code in nand_base.c

return  mtd->ecc_stats.corrected - stats.corrected ? -EUCLEAN : 0;

This is in the nand_do_read_ops in nand_bsae.c


I see that changing

if (rval != 0)


to

if (rval != 0 && rval != -EUCLEAN )


solves the problem.

I can submit a patch if required.


Thanks,
Sandeep

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2009-07-17  8:11 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-13 19:34 [U-Boot] Possible bug in NAND driver Paulraj, Sandeep
2009-07-14  9:03 ` Valeriy Glushkov
2009-07-14 10:51   ` [U-Boot] [PATCH] nand: fixed failed reads on corrected ECC errors in nand_util.c Valeriy Glushkov
2009-07-16 19:50     ` Scott Wood
2009-07-17  8:11       ` Valeriy Glushkov
2009-07-16 17:46 ` [U-Boot] Possible bug in NAND driver Scott Wood

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox