linux-mtd.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Ivan Djelic <ivan.djelic@parrot.com>
To: Christopher Harvey <charvey@matrox.com>
Cc: "stefan.bigler@keymile.com" <stefan.bigler@keymile.com>,
	"Brunck, Holger" <Holger.Brunck@keymile.com>,
	"linux-mtd@lists.infradead.org" <linux-mtd@lists.infradead.org>,
	Gerlando Falauto <gerlando.falauto@keymile.com>
Subject: Re: state of support for "external ECC hardware"
Date: Thu, 8 Nov 2012 19:59:42 +0100	[thread overview]
Message-ID: <20121108185942.GC28118@parrot.com> (raw)
In-Reply-To: <20121108152125.GR2389@harvey-pc.matrox.com>

On Thu, Nov 08, 2012 at 03:21:25PM +0000, Christopher Harvey wrote:
(...) 
> We had BCH8 code running, but it wasn't enough. The main reason we
> switched away from host side ECC was because we were getting bitflips
> within the ECC codeword data itself.

But the ECC bytes are part of the BCH codeword, therefore I don't understand
what the issue could be ? Are you sure bitflips were not in some unprotected
OOB area ?

 Yes, it would have been possible
> to add a 1 byte hamming code to protect the main ECC data, but it was
> just easier to say, "hey, Micron knows their hardware, so we'll trust
> their algorithms", and enable the Micron ECC hardware. Although it
> didn't require too much work to enable it's all a total hack. I took
> the code that runs the "ECC disabled mode", and sprinkled in some
> extra init code and error checking code. Would be nice to add an
> "external ecc mode" to support these chips explicitly.
> 
> > Support for software-based multiple-bit-resilient ECC mechanism (BCH) 
> > was posted (http://lwn.net/Articles/426856/) by Ivan Djelic (which I 
> > took liberty to Cc:) and merged in March last year.
> > I haven't been able to track how the situation evolved, but apparently 
> > you need to enable it (in addition to within the kernel configuration), 
> > also within your flash controller setup.
> > Micron gives an example of how to enable it on a sample NAND host 
> > controller S3C6410 in this TN (rest of the code, mainly from the above 
> > patch, would be already present in recent kernels):
> > http://www.micron.com/~/media/Documents/Products/Technical%20Note/NAND%20Flash/tn2971_software_bch_ecc_on_linux.pdf 
> 
> I haven't looked into current software ECC algorithms in the
> kernel. Do the protect against corrupted ECC data? As in, corruptions
> in the out of bounds area?

Yes, BCH ECC works by generating a codeword containing data+ecc bytes.
Errors can be detected and corrected in any location of the codeword (data and ecc).
Note that in practice, we are interested in actually fixing errors in data only (not ecc).
When an error is detected in ECC bytes, it must simply be reported to trigger block scrubbing.

The current software BCH implementation in MTD protects the page data area (and ecc bytes).
It does not protect additional bytes in the OOB area (like the Micron on-die ECC does),
but since the BCH library is not limited to any particular size, a simple patch could achieve this.
 
BR,
-- 
Ivan

  parent reply	other threads:[~2012-11-08 18:59 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-29 20:42 state of support for "external ECC hardware" Christopher Harvey
2012-11-08 11:02 ` Gerlando Falauto
2012-11-08 15:21   ` Christopher Harvey
2012-11-08 16:32     ` Gerlando Falauto
2012-11-08 16:37       ` Gerlando Falauto
2012-11-08 17:03         ` Christopher Harvey
2012-11-08 17:02       ` Christopher Harvey
2012-11-08 19:07       ` Ivan Djelic
2012-11-09  8:46       ` Ricard Wanderlof
2012-11-12 17:19         ` Gerlando Falauto
2012-11-12 17:35           ` Ivan Djelic
2012-11-12 17:39             ` Gerlando Falauto
2012-11-12 18:52               ` Ivan Djelic
2012-11-14 10:12                 ` Gerlando Falauto
2012-11-14 13:24                   ` Angus CLARK
2012-11-14 14:48                     ` Matthieu CASTET
2012-11-14 20:22                     ` Ivan Djelic
2012-11-20 11:13         ` Calvin Johnson
2012-11-20 11:35           ` Gerlando Falauto
2012-11-20 12:12             ` Calvin Johnson
2012-11-20 16:16           ` Ricard Wanderlof
2012-11-08 18:59     ` Ivan Djelic [this message]
2012-11-08 19:22       ` Christopher Harvey
2012-11-08 19:33         ` Ivan Djelic
2012-11-08 18:04   ` Ivan Djelic
2012-11-14 10:59 ` Angus CLARK

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=20121108185942.GC28118@parrot.com \
    --to=ivan.djelic@parrot.com \
    --cc=Holger.Brunck@keymile.com \
    --cc=charvey@matrox.com \
    --cc=gerlando.falauto@keymile.com \
    --cc=linux-mtd@lists.infradead.org \
    --cc=stefan.bigler@keymile.com \
    /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).