GPMI-NAND Status?

Ivan Djelic ivan.djelic at parrot.com
Mon Aug 15 04:29:35 EDT 2011


On Mon, Aug 15, 2011 at 06:41:23AM +0100, Lothar Waßmann wrote:
> Hi,
> 
> Ivan Djelic writes:
> > On Fri, Aug 05, 2011 at 02:51:33PM +0100, Wolfram Sang wrote:
> > (...)
> > > 
> > > problem overwriting all-0xff data in NAND [2]
> > > =============================================
> > > 
> > > Although it occured only when writing JFFS2 images so far, this is a generic
> > > issue and needs to be fixed, right?
> > > 
> > > 
> > (...)
> > > [2] http://lists.infradead.org/pipermail/linux-mtd/2011-July/037104.html
> > 
> > As explained in the thread linked above, this issue should be fixed in your
> > flashing tool, _not_ in your driver. The nand device you are using does not
> > support programming pages multiple times in a row; pretending it does in the
> >
> It's not a problem of the device (Samsung K9F1G08U0B in my case)! The
> problem is that the controller generates an ECC code that is non-FF
> for all-FF data, which JFFS2 cannot handle properly.

JFFS2 has nothing to do with it. JFFS2 does not assume it can program empty
pages and then reprogram them on a NAND flash device. You flashing method does.

If your BCH controller allows it, you could XOR the computed ECC bytes with a
specific mask to make sure all-FF data have all-FF ecc. This is useful to allow
reading erased blocks with ecc correction enabled.

But even so, you cannot work around the fact that NAND devices are different
from NOR devices, in that they typically allow only a limited number of partial
page programming operations (4 in your K9F1G08U0B).
If you implemented the mask trick described above and used it to allow
multiple page programming, you still would not track the number of partial
program operations on a given page, and expose yourself to nasty bugs (when
exceeding the number of specified partial operations); i.e. it could work on
some devices for a few operations, but not reliably on all devices for any
number of empty page programmings.

So the only real possibility is to avoid programming (physically) a page when
its target contents are empty (all-FF); this is not implemented at the driver
level because:
- it is useless: none of the existing filesystems need this "feature"
- it would waste cpu cycles to check if target data is all-FF each time a page
is programmed

Therefore... it is simply a matter of avoiding empty page programming, which
only happens in your flasher. See also the flashing guidelines [1] as per Artem
suggestion.

BR,

Ivan

[1] http://www.linux-mtd.infradead.org/doc/ubi.html#L_flasher_algo

> 
> 
> Lothar Waßmann
> -- 
> ___________________________________________________________
> 
> Ka-Ro electronics GmbH | Pascalstraße 22 | D - 52076 Aachen
> Phone: +49 2408 1402-0 | Fax: +49 2408 1402-10
> Geschäftsführer: Matthias Kaussen
> Handelsregistereintrag: Amtsgericht Aachen, HRB 4996
> 
> www.karo-electronics.de | info at karo-electronics.de
> ___________________________________________________________



More information about the linux-mtd mailing list