Latest commit fee4380 Dec 18, 2017 @bbrezillon bbrezillon committed with richardweinberger mtd: nand: pxa3xx: Fix READOOB implementation
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: 43bcfd2 ("mtd: nand: pxa3xx: Add driver-specific ECC BCH support")
Cc: stable@vger.kernel.org
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>
Permalink
..
Failed to load latest commit information.
chips Merge tag 'for-linus-20171120' of git://git.infradead.org/linux-mtd Nov 23, 2017
devices Merge tag 'for-linus-20171120' of git://git.infradead.org/linux-mtd Nov 23, 2017
lpddr mtd: lpddr: show parent device in sysfs Oct 13, 2015
maps Merge tag 'for-linus-20171120' of git://git.infradead.org/linux-mtd Nov 23, 2017
nand mtd: nand: pxa3xx: Fix READOOB implementation Jan 6, 2018
onenand License cleanup: add SPDX GPL-2.0 license identifier to files with no… Nov 2, 2017
parsers mtd: sharpslpart: Add sharpslpart partition parser Nov 13, 2017
spi-nor Merge tag 'for-linus-20171120' of git://git.infradead.org/linux-mtd Nov 23, 2017
tests License cleanup: add SPDX GPL-2.0 license identifier to files with no… Nov 2, 2017
ubi Merge tag 'modules-for-v4.15' of git://git.kernel.org/pub/scm/linux/k… Nov 15, 2017
Kconfig kconfig: kill off GENERIC_IO option Nov 13, 2017
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no… Nov 2, 2017
afs.c mtd: partitions: make parsers return 'const' partition arrays Dec 9, 2015
ar7part.c mtd: partitions: make parsers return 'const' partition arrays Dec 9, 2015
bcm47xxpart.c mtd: extract TRX parser out of bcm47xxpart into a separated module Jun 22, 2017
bcm63xxpart.c mtd: bcm63xxpart: give width specifier an 'int', not 'size_t' Mar 7, 2016
cmdlinepart.c mtd: partitions: make parsers return 'const' partition arrays Dec 9, 2015
ftl.c Replace <asm/uaccess.h> with <linux/uaccess.h> globally Dec 24, 2016
inftlcore.c mtd: nand: Rename nand.h into rawnand.h Aug 13, 2017
inftlmount.c Replace <asm/uaccess.h> with <linux/uaccess.h> globally Dec 24, 2016
mtd_blkdevs.c mtd: blkdevs: Fix mtd block write failure Aug 12, 2017
mtdblock.c mtd: mtdblock: remove the needless mtdblks_lock Jan 7, 2015
mtdblock_ro.c mtd: Move major number definitions to major.h Nov 7, 2013
mtdchar.c mtdchar: get rid of pointless access_ok() Oct 17, 2017
mtdconcat.c mtd: remove the get_unmapped_area method Nov 13, 2017
mtdcore.c mtd: Fix mtd_check_oob_ops() Dec 18, 2017
mtdcore.h License cleanup: add SPDX GPL-2.0 license identifier to files with no… Nov 2, 2017
mtdoops.c mtdoops: don't erase flash at each boot Nov 15, 2012
mtdpart.c mtd: remove the get_unmapped_area method Nov 13, 2017
mtdsuper.c Rename superblock flags (MS_xyz -> SB_xyz) Nov 27, 2017
mtdswap.c mtd: mtdswap: fix spelling mistake: 'TRESHOLD' -> 'THRESHOLD' Nov 13, 2017
nftlcore.c mtd: nand: Rename nand.h into rawnand.h Aug 13, 2017
nftlmount.c mtd: nand: Rename nand.h into rawnand.h Aug 13, 2017
ofpart.c mtd: Convert to using %pOF instead of full_name Aug 15, 2017
redboot.c mtd: partitions: make parsers return 'const' partition arrays Dec 9, 2015
rfd_ftl.c mtd: remove some duplicative checks Mar 11, 2014
sm_ftl.c treewide: setup_timer() -> timer_setup() Nov 21, 2017
sm_ftl.h mtd: sm_ftl: cosmetic, use bool when possible Oct 25, 2010
ssfdc.c mtd: nand: Rename nand.h into rawnand.h Aug 13, 2017