This is a note to let you know that I've just added the patch titled mtd: spi-nor: core: Update flash's current address mode when changing address mode to the 6.2-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: mtd-spi-nor-core-update-flash-s-current-address-mode-when-changing-address-mode.patch and it can be found in the queue-6.2 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From 37513c56139b79dd43c1774513c28f8ab2b05224 Mon Sep 17 00:00:00 2001 From: Tudor Ambarus <tudor.ambarus@xxxxxxxxxx> Date: Fri, 31 Mar 2023 07:46:04 +0000 Subject: mtd: spi-nor: core: Update flash's current address mode when changing address mode From: Tudor Ambarus <tudor.ambarus@xxxxxxxxxx> commit 37513c56139b79dd43c1774513c28f8ab2b05224 upstream. The bug was obswerved while reading code. There are not many users of addr_mode_nbytes. Anyway, we should update the flash's current address mode when changing the address mode, fix it. We don't care for now about the set_4byte_addr_mode(nor, false) from spi_nor_restore(), as it is used at driver remove and shutdown. Fixes: d7931a215063 ("mtd: spi-nor: core: Track flash's internal address mode") Cc: stable@xxxxxxxxxxxxxxx Link: https://lore.kernel.org/r/20230331074606.3559258-9-tudor.ambarus@xxxxxxxxxx Signed-off-by: Tudor Ambarus <tudor.ambarus@xxxxxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- drivers/mtd/spi-nor/core.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) --- a/drivers/mtd/spi-nor/core.c +++ b/drivers/mtd/spi-nor/core.c @@ -2733,6 +2733,7 @@ static int spi_nor_quad_enable(struct sp static int spi_nor_init(struct spi_nor *nor) { + struct spi_nor_flash_parameter *params = nor->params; int err; err = spi_nor_octal_dtr_enable(nor, true); @@ -2774,9 +2775,10 @@ static int spi_nor_init(struct spi_nor * */ WARN_ONCE(nor->flags & SNOR_F_BROKEN_RESET, "enabling reset hack; may not recover from unexpected reboots\n"); - err = nor->params->set_4byte_addr_mode(nor, true); + err = params->set_4byte_addr_mode(nor, true); if (err && err != -ENOTSUPP) return err; + params->addr_mode_nbytes = 4; } return 0; Patches currently in stable-queue which might be from tudor.ambarus@xxxxxxxxxx are queue-6.2/spi-atmel-quadspi-don-t-leak-clk-enable-count-in-pm-.patch queue-6.2/spi-atmel-quadspi-free-resources-even-if-runtime-res.patch queue-6.2/ext4-fix-use-after-free-read-in-ext4_find_extent-for.patch queue-6.2/mtd-spi-nor-core-update-flash-s-current-address-mode-when-changing-address-mode.patch queue-6.2/mtd-spi-nor-spansion-enable-jffs2-write-buffer-for-infineon-s25hx-semper-flash.patch