This is a note to let you know that I've just added the patch titled mtd: spi-nor: core: Add erase size check for erase command initialization to the 5.11-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-add-erase-size-check-for-erase-command-initialization.patch and it can be found in the queue-5.11 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From 58fa22f68fcaff20ce4d08a6adffa64f65ccd37d Mon Sep 17 00:00:00 2001 From: Takahiro Kuwano <Takahiro.Kuwano@xxxxxxxxxxxx> Date: Fri, 2 Oct 2020 14:18:02 +0900 Subject: mtd: spi-nor: core: Add erase size check for erase command initialization From: Takahiro Kuwano <Takahiro.Kuwano@xxxxxxxxxxxx> commit 58fa22f68fcaff20ce4d08a6adffa64f65ccd37d upstream. Even if erase type is same as previous region, erase size can be different if the previous region is overlaid region. Since 'region->size' is assigned to 'cmd->size' for overlaid region, comparing 'erase->size' and 'cmd->size' can detect previous overlaid region. Fixes: 5390a8df769e ("mtd: spi-nor: add support to non-uniform SFDP SPI NOR flash memories") 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/13d47e8d8991b8a7fd8cc7b9e2a5319c56df35cc.1601612872.git.Takahiro.Kuwano@xxxxxxxxxxxx Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- drivers/mtd/spi-nor/core.c | 1 + 1 file changed, 1 insertion(+) --- a/drivers/mtd/spi-nor/core.c +++ b/drivers/mtd/spi-nor/core.c @@ -1516,6 +1516,7 @@ static int spi_nor_init_erase_cmd_list(s goto destroy_erase_cmd_list; if (prev_erase != erase || + erase->size != cmd->size || region->offset & SNOR_OVERLAID_REGION) { cmd = spi_nor_init_erase_cmd(region, erase); if (IS_ERR(cmd)) { Patches currently in stable-queue which might be from Takahiro.Kuwano@xxxxxxxxxxxx are queue-5.11/mtd-spi-nor-core-add-erase-size-check-for-erase-command-initialization.patch queue-5.11/mtd-spi-nor-sfdp-fix-wrong-erase-type-bitmask-for-overlaid-region.patch queue-5.11/mtd-spi-nor-sfdp-fix-last-erase-region-marking.patch queue-5.11/mtd-spi-nor-core-fix-erase-type-discovery-for-overlaid-region.patch