All of lore.kernel.org
 help / color / mirror / Atom feed
From: tkuw584924@gmail.com
To: linux-mtd@lists.infradead.org
Cc: vigneshr@ti.com, tudor.ambarus@microchip.com, richard@nod.at,
	Bacem.Daassi@infineon.com, tkuw584924@gmail.com,
	miquel.raynal@bootlin.com,
	Takahiro Kuwano <Takahiro.Kuwano@infineon.com>
Subject: [PATCH 4/4] mtd: spi-nor: core: Add erase size check for erase command initialization
Date: Fri,  2 Oct 2020 14:18:02 +0900	[thread overview]
Message-ID: <13d47e8d8991b8a7fd8cc7b9e2a5319c56df35cc.1601612872.git.Takahiro.Kuwano@infineon.com> (raw)
In-Reply-To: <cover.1601612872.git.Takahiro.Kuwano@infineon.com>

From: Takahiro Kuwano <Takahiro.Kuwano@infineon.com>

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.

Signed-off-by: Takahiro Kuwano <Takahiro.Kuwano@infineon.com>
---
 drivers/mtd/spi-nor/core.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/mtd/spi-nor/core.c b/drivers/mtd/spi-nor/core.c
index c7d5c86905fa..a560e8ce13cd 100644
--- a/drivers/mtd/spi-nor/core.c
+++ b/drivers/mtd/spi-nor/core.c
@@ -1364,6 +1364,7 @@ static int spi_nor_init_erase_cmd_list(struct spi_nor *nor,
 			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)) {
-- 
2.25.1


______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

  parent reply	other threads:[~2020-10-02  5:19 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-02  5:17 [PATCH 0/4] mtd: spi-nor: Fix non-uniform erase map issues tkuw584924
2020-10-02  5:17 ` [PATCH 1/4] mtd: spi-nor: sfdp: Fix wrong erase type bitmask for overlaid region tkuw584924
2020-10-02  5:18 ` [PATCH 2/4] mtd: spi-nor: sfdp: Fix last erase region marking tkuw584924
2020-10-02  5:18 ` [PATCH 3/4] mtd: spi-nor: core: Fix erase type discovery for overlaid region tkuw584924
2020-10-02  5:18 ` tkuw584924 [this message]
2021-01-24 10:34 ` [PATCH 0/4] mtd: spi-nor: Fix non-uniform erase map issues Tudor.Ambarus
2021-01-25  3:11   ` Takahiro Kuwano
2021-02-05 13:31 ` Tudor Ambarus

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=13d47e8d8991b8a7fd8cc7b9e2a5319c56df35cc.1601612872.git.Takahiro.Kuwano@infineon.com \
    --to=tkuw584924@gmail.com \
    --cc=Bacem.Daassi@infineon.com \
    --cc=Takahiro.Kuwano@infineon.com \
    --cc=linux-mtd@lists.infradead.org \
    --cc=miquel.raynal@bootlin.com \
    --cc=richard@nod.at \
    --cc=tudor.ambarus@microchip.com \
    --cc=vigneshr@ti.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.