From: Trent Piepho <trent.piepho@igorinstitute.com>
To: Sascha Hauer <sha@pengutronix.de>
Cc: Tibault Damman <tibault.damman@basalte.be>,
"barebox@lists.infradead.org" <barebox@lists.infradead.org>
Subject: Re: nand "BCH decoding failed" when using bch8_hw_romcode ecc mode
Date: Fri, 18 Mar 2022 14:41:33 -0700 [thread overview]
Message-ID: <CAMHeXxNRB5tLY7W8hj0hvMFj2sjE8c8jtbfSjkPv-LRq7Zohyw@mail.gmail.com> (raw)
In-Reply-To: <20220318115925.GC12181@pengutronix.de>
On Fri, Mar 18, 2022 at 5:00 AM Sascha Hauer <sha@pengutronix.de> wrote:
>
> On Fri, Mar 18, 2022 at 11:32:36AM +0100, Tibault Damman wrote:
> > Gah, I just saw how that mail was sent, let me try that again:
> >
> >
> > Because the data looks right(?), despite the error prints, I tried
> > ubiformat again from barebox, then booted linux from SD, and attached
> > the ubi nand partition in linux... which worked fine.
> > All volumes and data were there.
> >
> > Very confused about what's going wrong here.
>
> You can correctly write to the NAND and can even correctly read the
> data, that's good news.
Yes, NAND hardware likely works fine. This looks like a BCH layout flaw to me.
Some background: (for Tibault, I'm sure Sascha knows this!)
Normal read/writes to NAND use some kind of ECC. The real data is
written, unmodified, to NAND, and then also some extra bytes of ECC
information. The real data and the ECC data are probably interleaved
in various complicated ways that are a pain to deal with.
Suppose the ECC data isn't done correctly. It's generated
incorrectly, *written to the wrong spot*, read from the wrong
location, etc. It doesn't work. But we still write the real data
somewhere too. And can then read it back from that same place. Maybe
we are writing the real data to the incorrect locations, but as long
as we read it back from the same incorrect locations, it appears to
work.
So what happens? We can write data, then read it back, but get many
ECC errors, because ECC is broken.
This looks like your problem.
ECC needs to work, as modern MLC/TLC/QLC NAND is not reliable enough
to use without ECC. You can test one page one time and it worked with
no errors, but test the entire chip many times and it will become
clear it just isn't good enough.
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
next prev parent reply other threads:[~2022-03-18 21:43 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-16 13:45 Tibault Damman
2022-03-17 7:46 ` Sascha Hauer
2022-03-18 9:49 ` Tibault Damman
2022-03-18 10:32 ` Tibault Damman
2022-03-18 11:59 ` Sascha Hauer
2022-03-18 21:41 ` Trent Piepho [this message]
2022-03-21 8:04 ` Tibault Damman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAMHeXxNRB5tLY7W8hj0hvMFj2sjE8c8jtbfSjkPv-LRq7Zohyw@mail.gmail.com \
--to=trent.piepho@igorinstitute.com \
--cc=barebox@lists.infradead.org \
--cc=sha@pengutronix.de \
--cc=tibault.damman@basalte.be \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox