[PATCH/RFC v4 1/3] Shared BCH ECC library

Ivan Djelic ivan.djelic at parrot.com
Tue Mar 29 11:03:13 EDT 2011


On Tue, Mar 29, 2011 at 02:55:19PM +0100, Ricard Wanderlof wrote:
> However, if I introduce a single bit error in the page, bch_decode() fails 
> with -EBADMSG, and some further debugging reveals that 
> bch.c:compute_error_locator_polynomial() returns 4 in this particular 
> case, whereas bch.c:find_poly_roots() returns 0, the two don't match, and 
> the function exits with an error. I'm no wizard with the algorithms used 
> so i have no idea what is reasonable. I would assume both would return 1, 
> as there is one bit error that I've introduced.

Yes you are correct, the computed error locator polynomial seems wrong, it
should be of degree 1.

> I've dumped the read and calculated ECC and it looks like they are being 
> generated as expected; indeed, if there was a fault there reading ok pages 
> would also fail.
> 
> I'm a bit bewildered, as the algorithm appearently has been tested on a 
> Mips (albeit under QEMU). Of course it's very likely that I've made a 
> mistake somewhere, in that case it must be in the set-up, as the two files 
> which actually implement the algorithm are new and not patches to existing 
> files. I was thinking it was perhaps an endianess problem (our MIPS is 
> little-endian), but I see it's been tested on x86 too so it shouldn't be 
> that.
> 
> Any ideas?

I should be able to help if you provide me with the following information:

- your patch against 2.6.35
- on an erased page, could you please program just the first byte to 0x7f (in
raw mode, no ecc), then read the page back normally with ecc, and dump the
calculated ecc ?

If you wish I can also send you the userland test suite that I use for
validation.

Best Regards,

--
Ivan



More information about the linux-mtd mailing list