android_kernel_oneplus_msm8998/drivers/mtd
Tokunori Ikegami 9ce51a5b41 mtd: cfi_cmdset_0002: Use chip_good() to retry in do_write_oneword()
commit 37c673ade35c707d50583b5b25091ff8ebdeafd7 upstream.

As reported by the OpenWRT team, write requests sometimes fail on some
platforms.
Currently to check the state chip_ready() is used correctly as described by
the flash memory S29GL256P11TFI01 datasheet.
Also chip_good() is used to check if the write is succeeded and it was
implemented by the commit fb4a90bfcd ("[MTD] CFI-0002 - Improve error
checking").
But actually the write failure is caused on some platforms and also it can
be fixed by using chip_good() to check the state and retry instead.
Also it seems that it is caused after repeated about 1,000 times to retry
the write one word with the reset command.
By using chip_good() to check the state to be done it can be reduced the
retry with reset.
It is depended on the actual flash chip behavior so the root cause is
unknown.

Cc: Chris Packham <chris.packham@alliedtelesis.co.nz>
Cc: Joakim Tjernlund <Joakim.Tjernlund@infinera.com>
Cc: linux-mtd@lists.infradead.org
Cc: stable@vger.kernel.org
Reported-by: Fabio Bettoni <fbettoni@gmail.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
[vigneshr@ti.com: Fix a checkpatch warning]
Signed-off-by: Vignesh Raghavendra <vigneshr@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-10-05 12:27:37 +02:00
..
chips mtd: cfi_cmdset_0002: Use chip_good() to retry in do_write_oneword() 2019-10-05 12:27:37 +02:00
devices mtd: docg3: don't set conflicting BCH_CONST_PARAMS option 2018-11-21 09:27:42 +01:00
lpddr mtd: lpddr: show parent device in sysfs 2015-10-13 09:21:17 -07:00
maps mtd/maps: fix solutionengine.c printk format warnings 2018-09-26 08:35:05 +02:00
nand mtd: rawnand: gpmi: fix MX28 bus master lockup problem 2019-02-20 10:13:17 +01:00
onenand mtd: onenand: fix deadlock in onenand_block_markbad 2016-04-12 09:09:05 -07:00
spi-nor mtd: spi-nor: Add support for is25wp series chips 2018-11-10 07:41:41 -08:00
tests mtd: tests: Replace timeval with ktime_t 2015-10-26 13:23:47 -07:00
ubi mtd: ubi: wl: Fix error return code in ubi_wl_init() 2018-09-19 22:49:00 +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 mtd: cmdlinepart: convert printk() to pr_*() 2015-09-28 18:37:32 -07:00
ftl.c
inftlcore.c
inftlmount.c
Kconfig
Makefile
mtd_blkdevs.c mtd: blkdevs: fix potential deadlock + lockdep warnings 2015-10-30 17:24:43 -07:00
mtdblock.c
mtdblock_ro.c
mtdchar.c mtdchar: fix overflows in adjustment of count 2018-09-26 08:35:08 +02:00
mtdconcat.c
mtdcore.c mtd: fix cmdlinepart parser, early naming for auto-filled MTD 2016-01-04 10:54:18 -08:00
mtdcore.h
mtdoops.c
mtdpart.c mtd: mtdpart: Do not fail mtd probe when parsing partitions fails 2015-10-26 18:43:48 -07:00
mtdsuper.c
mtdswap.c
nftlcore.c
nftlmount.c
ofpart.c doc: dt: mtd: partitions: add compatible property to "partitions" node 2015-12-08 17:10:20 -08:00
redboot.c
rfd_ftl.c
sm_ftl.c
sm_ftl.h
ssfdc.c