[PATCH] Newly erased page read workaround

Ivan Djelic ivan.djelic at parrot.com
Fri Apr 1 12:09:40 EDT 2011


On Fri, Apr 01, 2011 at 03:16:01PM +0100, Artem Bityutskiy wrote:
> On Fri, 2011-04-01 at 16:04 +0200, Ivan Djelic wrote:
> > On Fri, Apr 01, 2011 at 02:04:41PM +0100, Artem Bityutskiy wrote:
> > > On Fri, 2011-04-01 at 14:14 +0200, Ivan Djelic wrote:
> > > > Did you consider this idea: if you have an unused byte available in oob,
> > > > program it to 0x00 when a page is programmed.
> > > 
> > > I guess this depends on the the controller, but probably this could mean
> > > a substantial write  overhead, not?
> > 
> > Sorry, my explanation was probably not very clear.
> > 
> > When you program a page, you send data and oob contents to your NAND controller.
> > The controller may modify oob contents to add ECC bytes, in a more or less
> > automatic way, then it will physically program the page.
> 
> Right, I just assumed that some controllers allow you to send only data,
> and programming OOB would be a separate operation. But if this is not
> the case in ST's HW - then this sounds like a very good approach!

I had a quick look at fsmc_nand.c, and I don't see anything in the controller
preventing this approach. The driver provides an IO_ADDR_W address for sending
data to the NAND device, and lets mtd upper layers do the job. By implementing
the page writing function in the driver, one could clear the marker in the oob
array before programming (and check it in the page reading function).

I would be very surprised if the controller did not allow control over oob
contents other than ecc bytes. By doing so, it would prevent things like
software bad block marking. But sometimes hardware can be very surprising :)

BR,

Ivan



More information about the linux-mtd mailing list