linux-stable/drivers/mtd/spi-nor
Chen-Tsung Hsieh ca3f0824f2 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:25:44 +02:00
..
controllers mtd: spi-nor: nxp-spifi: Make use of the helper function devm_platform_ioremap_resource_byname() 2021-10-15 11:58:50 +03:00
atmel.c mtd: spi-nor: Rework the flash_info flags 2021-12-07 17:05:11 +02:00
catalyst.c mtd: spi-nor: Rework the flash_info flags 2021-12-07 17:05:11 +02:00
core.c mtd: spi-nor: core: Check written SR value in spi_nor_write_16bit_sr_and_check() 2022-06-09 10:25:44 +02:00
core.h mtd: spi-nor: Rework the flash_info flags 2021-12-07 17:05:11 +02:00
eon.c mtd: spi-nor: Rework the flash_info flags 2021-12-07 17:05:11 +02:00
esmt.c mtd: spi-nor: Rework the flash_info flags 2021-12-07 17:05:11 +02:00
everspin.c mtd: spi-nor: Rework the flash_info flags 2021-12-07 17:05:11 +02:00
fujitsu.c mtd: spi-nor: Rework the flash_info flags 2021-12-07 17:05:11 +02:00
gigadevice.c mtd: spi-nor: Constify part specific fixup hooks 2021-12-23 10:17:03 +02:00
intel.c mtd: spi-nor: Rework the flash_info flags 2021-12-07 17:05:11 +02:00
issi.c mtd: spi-nor: Constify part specific fixup hooks 2021-12-23 10:17:03 +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: Constify part specific fixup hooks 2021-12-23 10:17:03 +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: write 2 bytes when disabling Octal DTR mode 2021-12-23 15:04:13 +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: write 2 bytes when disabling Octal DTR mode 2021-12-23 15:04:13 +02:00
sst.c mtd: spi-nor: Rework the flash_info flags 2021-12-07 17:05:11 +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: Constify part specific fixup hooks 2021-12-23 10:17:03 +02:00
xilinx.c mtd: spi-nor: core: Don't use mtd_info in the NOR's probe sequence of calls 2021-12-07 17:05:10 +02:00
xmc.c mtd: spi-nor: Rework the flash_info flags 2021-12-07 17:05:11 +02:00