On 03/15/2016 09:35 AM, Stefan Christ wrote: > From: Elie De Brauwer > > The BCH block typically used with a GPMI block on an i.MX28/i.MX6 is only > able to correct bitflips on data actually streamed through the block. > When erasing a block the data does not stream through the BCH block > and therefore no ECC data is written to the NAND chip. This causes > gpmi_ecc_read_page to return failure as soon as a single non-1-bit is > found in an erased page. Typically causing problems at higher levels > (ubifs corrupted empty space warnings). This problem was also observed > when using SLC NAND devices. > > This patch configures the BCH block to mark a block as 'erased' if > not too much bitflips are found (by setting the erase threshold). A > consequence of this is that whenever an erased page is read, the > number of bitflips will be counted and corrected in software, > allowing the upper layers to take proper actions. > > Signed-off-by: Elie De Brauwer > Acked-by: Peter Korsgaard > Acked-by: Huang Shijie You moght want to coordinate with Markus (Cc'ed) as he tries to solve the same issue. Marc -- Pengutronix e.K. | Marc Kleine-Budde | Industrial Linux Solutions | Phone: +49-231-2826-924 | Vertretung West/Dortmund | Fax: +49-5121-206917-5555 | Amtsgericht Hildesheim, HRA 2686 | http://www.pengutronix.de |