[PATCH] mtd: denali: Disable sub-page writes in Denali NAND driver

Graham Moore grmoore at opensource.altera.com
Thu Feb 5 08:18:16 PST 2015

On 02/03/2015 04:23 PM, Richard Weinberger wrote:

> So this driver never worked?
> If it worked for some users we have to make sure that your change does not break
> existing setups.
> /me thinks of UBI.

Actually, we made this change to make UBIFS work.  So, yes, the driver 
never worked for UBI.  Worked fine for JFFS2, raw data.

A customer reported an issue with ECC errors when using UBIFS on NAND 
flash with Altera SoC.

We debugged it and found the ECC errors occur because the UBI subsystem 
is trying to write sub-pages in the NAND, but neither the NAND chip 
itself nor the Denali NAND controller support sub-page writes.

In more detail, the UBIFS tries to write a sub-page, but the controller 
writes a whole page instead.  The controller's buffer is initialized to 
FF, so all the data outside the subpage is FF.

But in this case, part of the page in the device is already non-FF.  And 
that data does not change when FF is written to it.

The Denali controller calculates ECC on the data written, but that data 
will not match the data in the device, and so the ECC is incorrect.

When a subsequent read occurs, the ECC will not match and an error will 

Graham Moore

More information about the linux-mtd mailing list