From: Mike Dunn <mikedunn@newsguy.com>
To: Ivan Djelic <ivan.djelic@parrot.com>
Cc: Marek Vasut <marek.vasut@gmail.com>,
"robert.jarzmik@free.fr" <robert.jarzmik@free.fr>,
"linux-mtd@lists.infradead.org" <linux-mtd@lists.infradead.org>
Subject: Re: [PATCH] Add driver for M-sys / Sandisk diskonchip G4 nand flash
Date: Wed, 12 Oct 2011 18:18:47 -0700 [thread overview]
Message-ID: <4E963C77.70400@newsguy.com> (raw)
In-Reply-To: <20111012184903.GA9535@parrot.com>
On 10/12/2011 11:49 AM, Ivan Djelic wrote:
>
> Well, thanks to your ecc samples I have the answer now; the hardware does
> provide recv_ecc^calc_ecc, with a little twist: a parity code in inserted into
> data before performing BCH remainder computations.
Yup, you nailed it!
> I don't really know how the parity byte in step 3 is generated, or what its
> purpose is; it may be there to allow oob reading without performing a full BCH
> decode, but the code seems too small to me to protect anything in a useful way.
> The nice thing is, we don't really need this code to perform BCH decoding.
Yes, it's a hw-generated hamming code, and it's supposed to cover the 7 oob
bytes preceding it. Yes, for reading oob only. One of my TODOs is to check the
hamming code when reading oob only. So I did know about that and was including
it in my tests. What escaped me is the fact that all the page data needed to be
bit-reversed in order to get the same ecc from your code as was written in oob.
And prior to that, the fact that the hw generates calc_ecc ^ recvd_ecc, until
you pointed that out.
> Could you try this in your driver and tell me if it matches your errorpos[]
> results ?
Done. I left the original code in the driver when I added the new code, and
added some additional lines to verify identical results. All's well.
Thanks again for all the help. Nice to know what's going on, and not duplicate
your bch code needlessly. Thanks also for the pointers to the table-based bit
reversal alg.
Mike
next prev parent reply other threads:[~2011-10-13 1:19 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-10-10 14:48 [PATCH] Add driver for M-sys / Sandisk diskonchip G4 nand flash Mike Dunn
2011-10-10 15:51 ` Marek Vasut
2011-10-10 18:12 ` Ivan Djelic
2011-10-10 21:02 ` Mike Dunn
2011-10-11 11:50 ` Ivan Djelic
2011-10-11 19:17 ` Mike Dunn
2011-10-12 18:49 ` Ivan Djelic
2011-10-13 1:18 ` Mike Dunn [this message]
2011-10-13 6:58 ` Robert Jarzmik
2011-10-13 8:37 ` Ivan Djelic
2011-10-13 15:52 ` Mike Dunn
2011-10-10 20:20 ` Mike Dunn
2011-10-12 21:28 ` Robert Jarzmik
2011-10-13 0:26 ` Marek Vasut
2011-10-13 2:25 ` Mike Dunn
2011-10-13 1:53 ` Mike Dunn
2011-10-17 21:45 ` Mike Dunn
2011-10-20 16:31 ` Artem Bityutskiy
2011-10-20 19:57 ` Mike Dunn
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=4E963C77.70400@newsguy.com \
--to=mikedunn@newsguy.com \
--cc=ivan.djelic@parrot.com \
--cc=linux-mtd@lists.infradead.org \
--cc=marek.vasut@gmail.com \
--cc=robert.jarzmik@free.fr \
/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;
as well as URLs for NNTP newsgroup(s).