linux-stable/drivers/mtd/nand/gpmi-nand
Sascha Hauer fdf2e82105 mtd: nand: gpmi: Fix failure when a erased page has a bitflip at BBM
When erased subpages are read then the BCH decoder returns STATUS_ERASED
if they are all empty, or STATUS_UNCORRECTABLE if there are bitflips.
When there are bitflips, we have to set these bits again to show the
upper layers a completely erased page. When a bitflip happens in the
exact byte where the bad block marker is, then this byte is swapped
with another byte in block_mark_swapping(). The correction code then
detects a bitflip in another subpage and no longer corrects the bitflip
where it really happens.

Correct this behaviour by calling block_mark_swapping() after the
bitflips have been corrected.

In our case UBIFS failed with this bug because it expects erased
pages to be really empty:

UBIFS error (pid 187): ubifs_scan: corrupt empty space at LEB 36:118735
UBIFS error (pid 187): ubifs_scanned_corruption: corruption at LEB 36:118735
UBIFS error (pid 187): ubifs_scanned_corruption: first 8192 bytes from LEB 36:118735
UBIFS error (pid 187): ubifs_scan: LEB 36 scanning failed
UBIFS error (pid 187): do_commit: commit failed, error -117

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Reviewed-by: Richard Weinberger <richard@nod.at>
Acked-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Signed-off-by: Richard Weinberger <richard@nod.at>
2017-12-15 22:26:15 +01:00
..
bch-regs.h mtd: gpmi: add gpmi support for imx6sx 2014-05-28 16:02:16 -07:00
gpmi-lib.c mtd: nand: gpmi: fix typo in comment 2017-06-10 12:09:28 +02:00
gpmi-nand.c mtd: nand: gpmi: Fix failure when a erased page has a bitflip at BBM 2017-12-15 22:26:15 +01:00
gpmi-nand.h mtd: nand: Rename nand.h into rawnand.h 2017-08-13 10:11:49 +02:00
gpmi-regs.h mtd: gpmi: decouple the chip select from the DMA channel 2013-11-06 23:33:01 -08:00
Makefile