[PATCH v2 2/6] mtd: spi-nor: add erase die (chip) capability

Tudor Ambarus tudor.ambarus at linaro.org
Thu Nov 2 10:54:32 PDT 2023


Does this help?

diff --git a/drivers/mtd/spi-nor/core.c b/drivers/mtd/spi-nor/core.c
index 05f3e93794bd..54e342a7e73c 100644
--- a/drivers/mtd/spi-nor/core.c
+++ b/drivers/mtd/spi-nor/core.c
@@ -1870,7 +1870,7 @@ static int spi_nor_erase(struct mtd_info *mtd,
struct erase_info *instr)

        if (n_dice) {
                die_size = div_u64(mtd->size, n_dice);
-               if (len == die_size && (addr & (die_size - 1)))
+               if (!(len & (die_size - 1)) && !(addr & (die_size - 1)))
                        multi_die_erase = true;
        } else {
                die_size = mtd->size;



More information about the linux-mtd mailing list