alistair23-linux/drivers/mtd
Brian Norris 28fa65e643 mtd: nand: fix off-by-one read retry mode counting
A flash may support N read retry voltage threshold modes, numbered 0
through N-1 (where mode 0 represents the initial state). However,
nand_do_read_ops() tries to use mode 0 through N.

This off-by-one error shows up, for instance, when using nanddump, and
we have cycled through available modes:

    nand: setting READ RETRY mode 0
    nand: setting READ RETRY mode 1
    nand: setting READ RETRY mode 2
    nand: setting READ RETRY mode 3
    nand: setting READ RETRY mode 4
    nand: setting READ RETRY mode 5
    nand: setting READ RETRY mode 6
    nand: setting READ RETRY mode 7
    nand: setting READ RETRY mode 8
    libmtd: error!: cannot read 8192 bytes from mtd0 (eraseblock 20, offset 0)
            error 22 (Invalid argument)
    nanddump: error!: mtd_read

Tested on Micron MT29F64G08CBCBBH1, with 8 retry modes.

Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Acked-by: Huang Shijie <b32955@freescale.com>
2014-02-14 12:08:20 -08:00
..
chips mtd: jedec_probe: fix LH28F640BF definition 2013-08-05 21:04:17 +01:00
devices mtd: m25p80: Set rx_nbits for Quad SPI transfers 2014-01-27 21:19:28 -08:00
lpddr mtd: lpddr: Mark functions as static and remove unused function 2014-01-03 11:22:26 -08:00
maps MTD updates for 3.14: 2014-01-28 18:56:37 -08:00
nand mtd: nand: fix off-by-one read retry mode counting 2014-02-14 12:08:20 -08:00
onenand mtd: onenand: Trivial cleanup in samsung.h 2014-01-11 12:00:25 -08:00
tests mtd: tests: mtd_nandecctest: Use IS_ENABLED() macro 2014-01-03 11:22:21 -08:00
ubi UBI: avoid program operation on NOR flash after erasure interrupted 2014-01-09 18:25:38 +02:00
afs.c mtd: make register_mtd_parser return void 2014-01-03 11:22:22 -08:00
ar7part.c mtd: make register_mtd_parser return void 2014-01-03 11:22:22 -08:00
bcm47xxpart.c mtd: bcm47xxpart: alternative MAGIC for board_data partition 2014-01-07 10:07:37 -08:00
bcm63xxpart.c mtd: make register_mtd_parser return void 2014-01-03 11:22:22 -08:00
cmdlinepart.c mtd: make register_mtd_parser return void 2014-01-03 11:22:22 -08:00
ftl.c
inftlcore.c mtd: nand: add a helper to detect the nand type 2013-10-27 16:27:06 -07:00
inftlmount.c
Kconfig mtd: Hide CONFIG_MTD_BLKDEVS from the menu 2014-01-07 10:07:36 -08:00
Makefile
mtd_blkdevs.c
mtdblock.c mtd: Move major number definitions to major.h 2013-11-06 23:32:59 -08:00
mtdblock_ro.c mtd: Move major number definitions to major.h 2013-11-06 23:32:59 -08:00
mtdchar.c mtd: mtdchar: return expected errors on mmap() call 2013-11-11 11:18:15 -08:00
mtdconcat.c
mtdcore.c mtd: convert to use ATTRIBUTE_GROUPS 2014-01-03 11:22:21 -08:00
mtdcore.h
mtdoops.c
mtdpart.c mtd: make register_mtd_parser return void 2014-01-03 11:22:22 -08:00
mtdsuper.c mtd: Move major number definitions to major.h 2013-11-06 23:32:59 -08:00
mtdswap.c mtd: mtdswap: replace strict_strtoul() with kstrtoul() 2013-08-30 21:52:51 +01:00
nftlcore.c mtd: nand: add a helper to detect the nand type 2013-10-27 16:27:06 -07:00
nftlmount.c
ofpart.c mtd: make register_mtd_parser return void 2014-01-03 11:22:22 -08:00
redboot.c mtd: make register_mtd_parser return void 2014-01-03 11:22:22 -08:00
rfd_ftl.c
sm_ftl.c mtd: sm_ftl: Staticize local symbols 2013-08-30 21:51:25 +01:00
sm_ftl.h
ssfdc.c mtd: nand: add a helper to detect the nand type 2013-10-27 16:27:06 -07:00