[PATCH v2] mtd: nand: Add driver for M-sys / Sandisk diskonchip G4

Ivan Djelic ivan.djelic at parrot.com
Fri Nov 4 12:58:24 EDT 2011


On Fri, Nov 04, 2011 at 04:23:52PM +0100, Ivan Djelic wrote:
> On Fri, Nov 04, 2011 at 02:20:26PM +0000, Mike Dunn wrote:
> > On 11/03/2011 02:14 AM, Matthieu CASTET wrote:
> > > Hi,
> > >
> > > Ivan Djelic a écrit :
> > >>
> > >> 1. When you program a page, before writing hwecc to oob, adjust it like this:
> > >>
> > >>    hwecc[i] ^= blank_read_hwecc[i]^0xff;
> > >>
> > >> The effect of this is that you now get 0xffs as ecc for blank pages, and bitflip
> > >> correction on erased pages for free. This is transparent to your controller,
> > >> because this "adjustment" cancels itself upon reading when calc_ecc^recv_ecc is
> > >> computed.
> > 
> > 
> > Not entirely transparent.  I didn't think this through.  Modifying the
> > hw-generated ecc bytes causes the hw to think that there were error(s) on every
> > page.  True, the driver will know better, but it will slow things down because
> > ordinarily the ecc unit only has to be read when the hardware reports errors. 
> > With this scheme, an error is reported and the ecc bytes read and processed on
> > every page.
> 

Oops, forget what I said in my previous post; I should have said the opposite:
that is, my XOR masking idea only works if the controller does not compute
recv_ecc^calc_ecc itself. So indeed you're right, it's not useful in your case.

BR,
--
Ivan



More information about the linux-mtd mailing list