android_kernel_oneplus_msm8998/drivers/mtd
Markus Pargmann a7cf2fb70a gpmi-nand: Handle ECC Errors in erased pages
commit bd2e778c9ee361c23ccb2b10591712e129d97893 upstream.

ECC is only calculated for written pages. As erased pages are not
actively written the ECC is always invalid. For this purpose the
Hardware BCH unit is able to check for erased pages and does not raise
an ECC error in this case. This behaviour can be influenced using the
BCH_MODE register which sets the number of allowed bitflips in an erased
page. Unfortunately the unit is not capable of fixing the bitflips in
memory.

To avoid complete software checks for erased pages, we can simply check
buffers with uncorrectable ECC errors because we know that any erased
page with errors is uncorrectable by the BCH unit.

This patch adds the generic nand_check_erased_ecc_chunk() to gpmi-nand
to correct erased pages. To have the valid data in the buffer before
using them, this patch moves the read_page_swap_end() call before the
ECC status checking for-loop.

Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
[Squashed patches by Stefan and Boris to check ECC area]
Tested-by: Stefan Christ <s.christ@phytec.de>
Acked-by: Han xu <han.xu@nxp.com>
Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Cc: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-16 10:06:47 +02:00
..
chips mtd: cfi: cmdset_0002: Do not allow read/write to suspend erase block. 2018-05-02 07:53:42 -07:00
devices
lpddr
maps mtd: maps: add __init attribute 2018-02-25 11:03:44 +01:00
nand gpmi-nand: Handle ECC Errors in erased pages 2018-05-16 10:06:47 +02:00
onenand
spi-nor mtd: spi-nor: fix spansion quad enable 2017-06-29 12:48:52 +02:00
tests
ubi ubi: Reject MLC NAND 2018-04-24 09:32:05 +02:00
afs.c
ar7part.c
bcm47xxpart.c mtd: bcm47xxpart: don't fail because of bit-flips 2017-07-05 14:37:18 +02:00
bcm63xxpart.c
cmdlinepart.c
ftl.c
inftlcore.c
inftlmount.c
Kconfig
Makefile
mtd_blkdevs.c
mtdblock.c
mtdblock_ro.c
mtdchar.c
mtdconcat.c
mtdcore.c
mtdcore.h
mtdoops.c
mtdpart.c
mtdsuper.c
mtdswap.c
nftlcore.c
nftlmount.c
ofpart.c
redboot.c
rfd_ftl.c
sm_ftl.c
sm_ftl.h
ssfdc.c