android_kernel_oneplus_msm8998/drivers/mtd/nand
Karl Beldan 05d721d61e mtd: nand: davinci: Reinitialize the HW ECC engine in 4bit hwctl
commit f6d7c1b5598b6407c3f1da795dd54acf99c1990c upstream.

This fixes subpage writes when using 4-bit HW ECC.

There has been numerous reports about ECC errors with devices using this
driver for a while.  Also the 4-bit ECC has been reported as broken with
subpages in [1] and with 16 bits NANDs in the driver and in mach* board
files both in mainline and in the vendor BSPs.

What I saw with 4-bit ECC on a 16bits NAND (on an LCDK) which got me to
try reinitializing the ECC engine:
- R/W on whole pages properly generates/checks RS code
- try writing the 1st subpage only of a blank page, the subpage is well
  written and the RS code properly generated, re-reading the same page
  the HW detects some ECC error, reading the same page again no ECC
  error is detected

Note that the ECC engine is already reinitialized in the 1-bit case.

Tested on my LCDK with UBI+UBIFS using subpages.
This could potentially get rid of the issue workarounded in [1].

[1] 28c015a9da ("mtd: davinci-nand: disable subpage write for keystone-nand")

Fixes: 6a4123e581 ("mtd: nand: davinci_nand, 4-bit ECC for smallpage")
Signed-off-by: Karl Beldan <kbeldan@baylibre.com>
Acked-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-10-07 15:23:40 +02:00
..
bcm47xxnflash mtd: nand: bcm47xxnflash: show parent device in sysfs 2015-10-13 12:56:26 -07:00
brcmnand mtd: brcmnand: Fix v7.1 register offsets 2016-05-04 14:48:52 -07:00
gpmi-nand mtd: nand: pass page number to ecc->write_xxx() methods 2015-10-13 12:56:49 -07:00
ams-delta.c
atmel_nand.c mtd: nand: pass page number to ecc->write_xxx() methods 2015-10-13 12:56:49 -07:00
atmel_nand_ecc.h
atmel_nand_nfc.h
au1550nd.c mtd: nand: au1550nd: show parent device in sysfs 2015-10-13 12:56:25 -07:00
bf5xx_nand.c mtd: nand: pass page number to ecc->write_xxx() methods 2015-10-13 12:56:49 -07:00
cafe_nand.c mtd: nand: pass page number to ecc->write_xxx() methods 2015-10-13 12:56:49 -07:00
cmx270_nand.c
cs553x_nand.c
davinci_nand.c mtd: nand: davinci: Reinitialize the HW ECC engine in 4bit hwctl 2016-10-07 15:23:40 +02:00
denali.c mtd: nand: pass page number to ecc->write_xxx() methods 2015-10-13 12:56:49 -07:00
denali.h
denali_dt.c
denali_pci.c
diskonchip.c
docg4.c mtd: nand: pass page number to ecc->write_xxx() methods 2015-10-13 12:56:49 -07:00
fsl_elbc_nand.c mtd: nand: pass page number to ecc->write_xxx() methods 2015-10-13 12:56:49 -07:00
fsl_ifc_nand.c mtd: nand: pass page number to ecc->write_xxx() methods 2015-10-13 12:56:49 -07:00
fsl_upm.c mtd: nand: fsl_upm: show parent device in sysfs 2015-10-13 12:56:47 -07:00
fsmc_nand.c mtd: fsmc_nand: Add BCH4 SW ECC support for SPEAr600 2015-10-26 13:19:40 -07:00
gpio.c mtd: nand: gpio: show parent device in sysfs 2015-10-13 12:56:44 -07:00
hisi504_nand.c mtd: nand: pass page number to ecc->write_xxx() methods 2015-10-13 12:56:49 -07:00
jz4740_nand.c mtd: jz4740_nand: fix build on jz4740 after removing gpio.h 2015-11-16 10:48:15 -08:00
Kconfig mtd: nand: Allow MTD_NAND_BRCMNAND to be selected for ARM64 2015-10-12 14:17:40 -07:00
lpc32xx_mlc.c mtd: lpc32xx_mlc: fix warnings caused by enabling unprepared clock 2015-10-19 18:23:15 -07:00
lpc32xx_slc.c mtd: lpc32xx_slc: fix warnings caused by enabling unprepared clock 2015-10-19 18:23:14 -07:00
Makefile
mpc5121_nfc.c mtd: nand: mpc5121_nfc: show parent device in sysfs 2015-10-13 12:56:32 -07:00
mxc_nand.c mtd: nand: mxc_nand: drop owner assignment 2015-10-13 12:56:38 -07:00
nand_base.c mtd: nand: fix bug writing 1 byte less than page size 2016-08-20 18:09:24 +02:00
nand_bbt.c
nand_bch.c
nand_ecc.c
nand_ids.c
nand_timings.c
nandsim.c
ndfc.c mtd: nand: ndfc: show parent device in sysfs 2015-10-13 12:56:39 -07:00
nuc900_nand.c mtd: nand: nuc900_nand: show parent device in sysfs 2015-10-13 12:56:33 -07:00
omap2.c mtd: nand: pass page number to ecc->write_xxx() methods 2015-10-13 12:56:49 -07:00
omap_elm.c
orion_nand.c mtd: nand: orion_nand: show parent device in sysfs 2015-10-13 12:56:33 -07:00
pasemi_nand.c mtd: nand: pasemi_nand: show parent device in sysfs 2015-10-13 12:56:39 -07:00
plat_nand.c mtd: nand: plat_nand: show parent device in sysfs 2015-10-13 12:56:34 -07:00
pxa3xx_nand.c mtd: pxa3xx_nand: clean up the pxa3xx timings 2015-10-26 11:38:12 -07:00
r852.c mtd: nand: r852: drop owner assignment 2015-10-13 12:56:35 -07:00
r852.h
s3c2410.c mtd: nand: s3c2410: show parent device in sysfs 2015-10-13 12:56:42 -07:00
sh_flctl.c mtd: nand: pass page number to ecc->write_xxx() methods 2015-10-13 12:56:49 -07:00
sharpsl.c mtd: nand: sharpsl: show parent device in sysfs 2015-10-13 12:56:42 -07:00
sm_common.c
sm_common.h
socrates_nand.c mtd: nand: socrates_nand: drop owner assignment 2015-10-13 12:56:46 -07:00
sunxi_nand.c mtd: nand: sunxi: avoid retrieving data before ECC pass 2015-11-02 12:54:37 -08:00
tmio_nand.c mtd: nand: tmio_nand: show parent device in sysfs 2015-10-13 12:56:37 -07:00
txx9ndfmc.c mtd: nand: txx9ndfmc: show parent device in sysfs 2015-10-13 12:56:48 -07:00
vf610_nfc.c mtd: nand: vf610_nfc: use nand_check_erased_ecc_chunk() helper 2015-10-26 13:05:42 -07:00
xway_nand.c