* [U-Boot] JFFS2 seems to drop nand data with ECC corrections [not found] ` <CAG-iJ28j0PsUuxGLByaHmv3KdSmdxJ1sgk4kCJ_6ACER-YbCtQ@mail.gmail.com> @ 2012-12-01 17:02 ` Deltour, Stephane 2012-12-06 18:22 ` Scott Wood 0 siblings, 1 reply; 5+ messages in thread From: Deltour, Stephane @ 2012-12-01 17:02 UTC (permalink / raw) To: u-boot I had a few boards with NAND related problems. In Linux a file was written to a JFFS2 partition in NAND, but u-boot was unable to read the same file correctly from the JFFS2. This happened to be often the case if the NAND had a few bad blocks in the JFFS2 partition. Upon further examination it turned out Linux still was able to read the file 100% correctly from the partition, but u-boot wasn't. I did get a lot of "read_nand_cache: error reading nand off ..." messages in u-boot. When debugging further it appears that read_nand_cached(...) in /fs/jffs2/jffs2_1pass.c throws away the data if nand_read (/drivers/ mtd/nand/nand_base.c) doesn't return 0. This happens in case of an uncorrectable ECC error (-EBADMSG) or a correctable ECC error(-EUCLEAN). (see nand_do_read_ops in /drivers/ mtd/nand/nand_base.c) So this would mean that data gets thrown away in case of a correctable ECC error, which doesn't seem the right thing to do and probably does not match with how linux is behaving. I patched the code to not throw away data with correctable ECC errors and this seems to fix it for the two boards that had this issue. If it matters: the correctable ECC errors appeared in good blocks (but often close to a bad block). So would my understanding be 'correct'? Regards, Stephane Deltour PS: Sorry about the disclaimer, it is out of my control DISCLAIMER: Unless indicated otherwise, the information contained in this message is privileged and confidential, and is intended only for the use of the addressee(s) named above and others who have been specifically authorized to receive it. If you are not the intended recipient, you are hereby notified that any dissemination, distribution or copying of this message and/or attachments is strictly prohibited. The company accepts no liability for any damage caused by any virus transmitted by this email. Furthermore, the company does not warrant a proper and complete transmission of this information, nor does it accept liability for any delays. If you have received this message in error, please contact the sender and delete the message. Thank you. ^ permalink raw reply [flat|nested] 5+ messages in thread
* [U-Boot] JFFS2 seems to drop nand data with ECC corrections 2012-12-01 17:02 ` [U-Boot] JFFS2 seems to drop nand data with ECC corrections Deltour, Stephane @ 2012-12-06 18:22 ` Scott Wood 2012-12-10 7:33 ` Deltour, Stephane 0 siblings, 1 reply; 5+ messages in thread From: Scott Wood @ 2012-12-06 18:22 UTC (permalink / raw) To: u-boot On 12/01/2012 11:02:05 AM, Deltour, Stephane wrote: > I had a few boards with NAND related problems. In Linux a file was > written to a JFFS2 partition in NAND, but u-boot was unable to read > the > same file correctly from the JFFS2. This happened to be often the case > if the NAND had a few bad blocks in the JFFS2 partition. > Upon further examination it turned out Linux still was able to read > the > file 100% correctly from the partition, but u-boot wasn't. > I did get a lot of "read_nand_cache: error reading nand off ..." > messages in u-boot. > > When debugging further it appears that > read_nand_cached(...) in /fs/jffs2/jffs2_1pass.c > throws away the data if nand_read (/drivers/ mtd/nand/nand_base.c) > doesn't return 0. > This happens in case of an uncorrectable ECC error (-EBADMSG) or a > correctable ECC error(-EUCLEAN). > (see nand_do_read_ops in /drivers/ mtd/nand/nand_base.c) > > So this would mean that data gets thrown away in case of a correctable > ECC error, which doesn't seem the right thing to do and probably does > not match with how linux is behaving. > > I patched the code to not throw away data with correctable ECC errors > and this seems to fix it for the two boards that had this issue. > If it matters: the correctable ECC errors appeared in good blocks (but > often close to a bad block). > > So would my understanding be 'correct'? Yes. -Scott ^ permalink raw reply [flat|nested] 5+ messages in thread
* [U-Boot] JFFS2 seems to drop nand data with ECC corrections 2012-12-06 18:22 ` Scott Wood @ 2012-12-10 7:33 ` Deltour, Stephane 2012-12-10 18:10 ` Scott Wood 2013-05-30 17:34 ` passal 0 siblings, 2 replies; 5+ messages in thread From: Deltour, Stephane @ 2012-12-10 7:33 UTC (permalink / raw) To: u-boot Hi, Thanks for the confirmation. Is this something that may be patched ? I mean, would a patch for this be accepted ? Regards, Stephane Deltour -----Original Message----- From: Scott Wood [mailto:scottwood at freescale.com] Sent: donderdag 6 december 2012 19:23 To: Deltour, Stephane Cc: u-boot at lists.denx.de Subject: Re: [U-Boot] JFFS2 seems to drop nand data with ECC corrections On 12/01/2012 11:02:05 AM, Deltour, Stephane wrote: > I had a few boards with NAND related problems. In Linux a file was > written to a JFFS2 partition in NAND, but u-boot was unable to read > the same file correctly from the JFFS2. This happened to be often the > case if the NAND had a few bad blocks in the JFFS2 partition. > Upon further examination it turned out Linux still was able to read > the file 100% correctly from the partition, but u-boot wasn't. > I did get a lot of "read_nand_cache: error reading nand off ..." > messages in u-boot. > > When debugging further it appears that > read_nand_cached(...) in /fs/jffs2/jffs2_1pass.c throws away the data > if nand_read (/drivers/ mtd/nand/nand_base.c) doesn't return 0. > This happens in case of an uncorrectable ECC error (-EBADMSG) or a > correctable ECC error(-EUCLEAN). > (see nand_do_read_ops in /drivers/ mtd/nand/nand_base.c) > > So this would mean that data gets thrown away in case of a correctable > ECC error, which doesn't seem the right thing to do and probably does > not match with how linux is behaving. > > I patched the code to not throw away data with correctable ECC errors > and this seems to fix it for the two boards that had this issue. > If it matters: the correctable ECC errors appeared in good blocks (but > often close to a bad block). > > So would my understanding be 'correct'? Yes. -Scott DISCLAIMER: Unless indicated otherwise, the information contained in this message is privileged and confidential, and is intended only for the use of the addressee(s) named above and others who have been specifically authorized to receive it. If you are not the intended recipient, you are hereby notified that any dissemination, distribution or copying of this message and/or attachments is strictly prohibited. The company accepts no liability for any damage caused by any virus transmitted by this email. Furthermore, the company does not warrant a proper and complete transmission of this information, nor does it accept liability for any delays. If you have received this message in error, please contact the sender and delete the message. Thank you. ^ permalink raw reply [flat|nested] 5+ messages in thread
* [U-Boot] JFFS2 seems to drop nand data with ECC corrections 2012-12-10 7:33 ` Deltour, Stephane @ 2012-12-10 18:10 ` Scott Wood 2013-05-30 17:34 ` passal 1 sibling, 0 replies; 5+ messages in thread From: Scott Wood @ 2012-12-10 18:10 UTC (permalink / raw) To: u-boot On 12/10/2012 01:33:52 AM, Deltour, Stephane wrote: > Hi, > > Thanks for the confirmation. > > Is this something that may be patched ? > I mean, would a patch for this be accepted ? Yes, please send a patch. -Scott ^ permalink raw reply [flat|nested] 5+ messages in thread
* [U-Boot] JFFS2 seems to drop nand data with ECC corrections 2012-12-10 7:33 ` Deltour, Stephane 2012-12-10 18:10 ` Scott Wood @ 2013-05-30 17:34 ` passal 1 sibling, 0 replies; 5+ messages in thread From: passal @ 2013-05-30 17:34 UTC (permalink / raw) To: u-boot Hi Have you submitted this patch? Would it be possible to share this patch because we have the same problem? BR, Pierre Assal -- View this message in context: http://u-boot.10912.n7.nabble.com/JFFS2-seems-to-drop-nand-data-with-ECC-corrections-tp142008p155997.html Sent from the U-Boot mailing list archive at Nabble.com. ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2013-05-30 17:34 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <CAG-iJ2-oL49mqPzRhnCNa5rv76b3x0K7-pWBzBuPr3dq08KA_w@mail.gmail.com>
[not found] ` <CAG-iJ28j0PsUuxGLByaHmv3KdSmdxJ1sgk4kCJ_6ACER-YbCtQ@mail.gmail.com>
2012-12-01 17:02 ` [U-Boot] JFFS2 seems to drop nand data with ECC corrections Deltour, Stephane
2012-12-06 18:22 ` Scott Wood
2012-12-10 7:33 ` Deltour, Stephane
2012-12-10 18:10 ` Scott Wood
2013-05-30 17:34 ` passal
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox