remarkable-linux/drivers/mtd
Boris Brezillon 756ac0b046 mtd: nand: pxa3xx: Fix READOOB implementation
commit fee4380f36 upstream.

In the current driver, OOB bytes are accessed in raw mode, and when a
page access is done with NDCR_SPARE_EN set and NDCR_ECC_EN cleared, the
driver must read the whole spare area (64 bytes in case of a 2k page,
16 bytes for a 512 page). The driver was only reading the free OOB
bytes, which was leaving some unread data in the FIFO and was somehow
leading to a timeout.

We could patch the driver to read ->spare_size + ->ecc_size instead of
just ->spare_size when READOOB is requested, but we'd better make
in-band and OOB accesses consistent.
Since the driver is always accessing in-band data in non-raw mode (with
the ECC engine enabled), we should also access OOB data in this mode.
That's particularly useful when using the BCH engine because in this
mode the free OOB bytes are also ECC protected.

Fixes: 43bcfd2bb2 ("mtd: nand: pxa3xx: Add driver-specific ECC BCH support")
Reported-by: Sean Nyekjær <sean.nyekjaer@prevas.dk>
Tested-by: Willy Tarreau <w@1wt.eu>
Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Acked-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
Tested-by: Sean Nyekjaer <sean.nyekjaer@prevas.dk>
Acked-by: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-01-10 09:31:22 +01:00
..
chips License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
devices mtd: Avoid probe failures when mtd->dbg.dfs_dir is invalid 2017-11-30 08:40:51 +00:00
lpddr
maps License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
nand mtd: nand: pxa3xx: Fix READOOB implementation 2018-01-10 09:31:22 +01:00
onenand License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
parsers
spi-nor mtd: spi-nor: stm32-quadspi: Fix uninitialized error return code 2017-12-20 10:10:30 +01:00
tests License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
ubi License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
afs.c
ar7part.c
bcm47xxpart.c
bcm63xxpart.c
cmdlinepart.c
ftl.c
inftlcore.c mtd: nand: Rename nand.h into rawnand.h 2017-08-13 10:11:49 +02:00
inftlmount.c
Kconfig
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
mtd_blkdevs.c mtd: blkdevs: Fix mtd block write failure 2017-08-12 14:53:24 -07:00
mtdblock.c
mtdblock_ro.c
mtdchar.c
mtdconcat.c
mtdcore.c mtd: make device_type const 2017-08-21 14:33:50 +02:00
mtdcore.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
mtdoops.c
mtdpart.c mtd: Fix partition alignment check on multi-erasesize devices 2017-09-27 13:53:20 +02:00
mtdsuper.c
mtdswap.c mtd: mtdswap: remove unused variables 'dev' and 'gd' 2017-07-24 17:04:33 -07:00
nftlcore.c mtd: nand: Rename nand.h into rawnand.h 2017-08-13 10:11:49 +02:00
nftlmount.c mtd: nand: Rename nand.h into rawnand.h 2017-08-13 10:11:49 +02:00
ofpart.c mtd: Convert to using %pOF instead of full_name 2017-08-15 14:00:43 +02:00
redboot.c
rfd_ftl.c
sm_ftl.c
sm_ftl.h
ssfdc.c mtd: nand: Rename nand.h into rawnand.h 2017-08-13 10:11:49 +02:00