You are right, this is a bug. I've already fixed it in our code tree some monthes ago but forgotten to send the patch to the list.
Best regards, Valeriy Glushkov ----- Original Message ----- From: "Paulraj, Sandeep" <s-paul...@ti.com> To: <u-boot@lists.denx.de> Sent: 13 ???? 2009 ?. 22:34 Subject: [U-Boot] Possible bug in NAND driver > > 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 > > _______________________________________________ > U-Boot mailing list > U-Boot@lists.denx.de > http://lists.denx.de/mailman/listinfo/u-boot _______________________________________________ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot