This is a note to let you know that I've just added the patch titled mtd: spi-nor: sfdp: Fix last erase region marking to the 5.4-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-sfdp-fix-last-erase-region-marking.patch and it can be found in the queue-5.4 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From 9166f4af32db74e1544a2149aef231ff24515ea3 Mon Sep 17 00:00:00 2001 From: Takahiro Kuwano <Takahiro.Kuwano@xxxxxxxxxxxx> Date: Fri, 2 Oct 2020 14:18:00 +0900 Subject: mtd: spi-nor: sfdp: Fix last erase region marking From: Takahiro Kuwano <Takahiro.Kuwano@xxxxxxxxxxxx> commit 9166f4af32db74e1544a2149aef231ff24515ea3 upstream. The place of spi_nor_region_mark_end() must be moved, because 'i' is re-used for the index of erase[]. Fixes: b038e8e3be72 ("mtd: spi-nor: parse SFDP Sector Map Parameter Table") Cc: stable@xxxxxxxxxxxxxxx Signed-off-by: Takahiro Kuwano <Takahiro.Kuwano@xxxxxxxxxxxx> [ta: Add Fixes tag and Cc to stable] Signed-off-by: Tudor Ambarus <tudor.ambarus@xxxxxxxxxxxxx> Link: https://lore.kernel.org/r/02ce8d84b7989ebee33382f6494df53778dd508e.1601612872.git.Takahiro.Kuwano@xxxxxxxxxxxx Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- drivers/mtd/spi-nor/spi-nor.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) --- a/drivers/mtd/spi-nor/spi-nor.c +++ b/drivers/mtd/spi-nor/spi-nor.c @@ -3770,6 +3770,7 @@ spi_nor_init_non_uniform_erase_map(struc offset = (region[i].offset & ~SNOR_ERASE_FLAGS_MASK) + region[i].size; } + spi_nor_region_mark_end(®ion[i - 1]); save_uniform_erase_type = map->uniform_erase_type; map->uniform_erase_type = spi_nor_sort_erase_mask(map, @@ -3793,8 +3794,6 @@ spi_nor_init_non_uniform_erase_map(struc if (!(regions_erase_type & BIT(erase[i].idx))) spi_nor_set_erase_type(&erase[i], 0, 0xFF); - spi_nor_region_mark_end(®ion[i - 1]); - return 0; } Patches currently in stable-queue which might be from Takahiro.Kuwano@xxxxxxxxxxxx are queue-5.4/mtd-spi-nor-core-add-erase-size-check-for-erase-command-initialization.patch queue-5.4/mtd-spi-nor-sfdp-fix-wrong-erase-type-bitmask-for-overlaid-region.patch queue-5.4/mtd-spi-nor-sfdp-fix-last-erase-region-marking.patch queue-5.4/mtd-spi-nor-core-fix-erase-type-discovery-for-overlaid-region.patch