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

From: Graham Moore
Date: Thu Feb 05 2015 - 11:35:32 EST




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 occur.

Thanks,
Graham Moore
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/