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

Robert Jarzmik robert.jarzmik at free.fr
Thu Nov 3 07:02:11 EDT 2011


----- Mail Original -----
De: "Ivan Djelic" <ivan.djelic at parrot.com>
À: "Mike Dunn" <mikedunn at newsguy.com>
Cc: linux-mtd at lists.infradead.org
Envoyé: Jeudi 3 Novembre 2011 09h58:24 GMT +01:00 Amsterdam / Berlin / Berne / Rome / Stockholm / Vienne
Objet: Re: [PATCH v2] mtd: nand: Add driver for M-sys / Sandisk diskonchip G4

> Using this blank ecc value to detect blank pages after reading them is not that
> reliable, because if a bitflip appears in an erased page, the HW ecc generator
> will generate a completely different sequence of bytes. Your driver will think
> the page is not blank, it will try to correct errors and fail. And UBIFS will
> not appreciate that.
> I can see two cleaner alternatives to solve this issue:
>
> 1. When you program a page, before writing hwecc to oob, adjust it like this:
> 2. Use unprotected spare oob byte 15 as a programmming marker: remove it from
> ...zip...

I would see a third one:
3. After reading the page, check bit DOC_ECCCONF1_PAGE_IS_WRITTEN in DOC_ECCCONF1 register.
   I think this bit is calculated from the Hamming Code (not sure), but I'm pretty sure that
   this bit is 0 when the page is blank, and 1 if the page was written before.

--
Robert




More information about the linux-mtd mailing list