linux-stable/drivers/mtd/spi-nor
Chen-Tsung Hsieh 0b3ca36c7b mtd: spi-nor: core: Check written SR value in spi_nor_write_16bit_sr_and_check()
[ Upstream commit 70dd83d737 ]

Read back Status Register 1 to ensure that the written byte match the
received value and return -EIO if read back test failed.

Without this patch, spi_nor_write_16bit_sr_and_check() only check the
second half of the 16bit. It causes errors like spi_nor_sr_unlock()
return success incorrectly when spi_nor_write_16bit_sr_and_check()
doesn't write SR successfully.

Fixes: 39d1e3340c ("mtd: spi-nor: Fix clearing of QE bit on lock()/unlock()")
Signed-off-by: Chen-Tsung Hsieh <chentsung@chromium.org>
Signed-off-by: Pratyush Yadav <p.yadav@ti.com>
Reviewed-by: Michael Walle <michael@walle.cc>
Reviewed-by: Tudor Ambarus <tudor.ambarus@microchip.com>
Acked-by: Pratyush Yadav <p.yadav@ti.com>
Link: https://lore.kernel.org/r/20220126073227.3401275-1-chentsung@chromium.org
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-06-09 10:30:03 +02:00
..
controllers Core MTD changes: 2022-03-25 13:35:34 -07:00
atmel.c mtd: spi-nor: atmel: unify function names 2022-02-25 09:44:31 +02:00
catalyst.c mtd: spi-nor: catalyst: unify function names 2022-02-25 09:44:31 +02:00
core.c mtd: spi-nor: core: Check written SR value in spi_nor_write_16bit_sr_and_check() 2022-06-09 10:30:03 +02:00
core.h mtd: spi-nor: renumber flags 2022-02-25 18:13:20 +02:00
eon.c mtd: spi-nor: eon: unify function names 2022-02-25 09:44:31 +02:00
esmt.c mtd: spi-nor: esmt: unify function names 2022-02-25 09:44:31 +02:00
everspin.c mtd: spi-nor: everspin: unify function names 2022-02-25 09:44:31 +02:00
fujitsu.c mtd: spi-nor: fujitsu: unify function names 2022-02-25 09:44:31 +02:00
gigadevice.c mtd: spi-nor: gigadevice: unify function names 2022-02-25 09:44:31 +02:00
intel.c mtd: spi-nor: intel: unify function names 2022-02-25 09:44:31 +02:00
issi.c mtd: spi-nor: issi: unify function names 2022-02-25 09:44:31 +02:00
Kconfig mtd: spi-nor: keep lock bits if they are non-volatile 2020-12-07 23:01:15 +05:30
macronix.c mtd: spi-nor: macronix: unify function names 2022-02-25 09:44:31 +02:00
Makefile mtd: spi-nor: add initial sysfs support 2021-06-15 23:18:32 +05:30
micron-st.c mtd: spi-nor: micron-st: rename vendor specific functions and defines 2022-02-25 18:12:35 +02:00
otp.c mtd: spi-nor: Introduce spi_nor_set_mtd_info() 2021-12-07 17:05:10 +02:00
sfdp.c mtd: spi-nor: core: Call spi_nor_post_sfdp_fixups() only when SFDP is defined 2021-12-07 17:05:10 +02:00
sfdp.h mtd: spi-nor: Get rid of duplicated argument in spi_nor_parse_sfdp() 2021-03-15 18:01:47 +02:00
spansion.c mtd: spi-nor: spansion: rename vendor specific functions and defines 2022-02-25 18:13:01 +02:00
sst.c mtd: spi-nor: sst: unify function names 2022-02-25 09:44:32 +02:00
swp.c mtd: spi-nor: Introduce spi_nor_set_mtd_info() 2021-12-07 17:05:10 +02:00
sysfs.c mtd: spi-nor: add initial sysfs support 2021-06-15 23:18:32 +05:30
winbond.c mtd: spi-nor: winbond: unify function names 2022-02-25 09:44:32 +02:00
xilinx.c mtd: spi-nor: xilinx: correct the debug message 2022-02-25 18:12:12 +02:00
xmc.c mtd: spi-nor: xmc: unify function names 2022-02-25 09:44:32 +02:00