public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH] mtd: spi-nor: remove unused NO_OP_CHIP_ERASE flag
@ 2026-04-16  9:03 tkuw584924
  2026-04-16  9:15 ` Tudor Ambarus
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: tkuw584924 @ 2026-04-16  9:03 UTC (permalink / raw)
  To: linux-mtd
  Cc: tudor.ambarus, pratyush, mwalle, miquel.raynal, richard, vigneshr,
	Bacem.Daassi, Takahiro Kuwano

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

NO_OP_CHIP_ERASE flag is no longer used.
Remove definition and references of the flag in core and debugfs.

Signed-off-by: Takahiro Kuwano <Takahiro.Kuwano@infineon.com>
---
 drivers/mtd/spi-nor/core.c    |  3 +--
 drivers/mtd/spi-nor/core.h    | 33 ++++++++++++++++-----------------
 drivers/mtd/spi-nor/debugfs.c |  7 ++-----
 3 files changed, 19 insertions(+), 24 deletions(-)

diff --git a/drivers/mtd/spi-nor/core.c b/drivers/mtd/spi-nor/core.c
index e6c1fda61f57..278b3fd0996e 100644
--- a/drivers/mtd/spi-nor/core.c
+++ b/drivers/mtd/spi-nor/core.c
@@ -1787,8 +1787,7 @@ static int spi_nor_erase(struct mtd_info *mtd, struct erase_info *instr)
 		return ret;
 
 	/* chip (die) erase? */
-	if ((len == mtd->size && !(nor->flags & SNOR_F_NO_OP_CHIP_ERASE)) ||
-	    multi_die_erase) {
+	if (len == mtd->size || multi_die_erase) {
 		ret = spi_nor_erase_dice(nor, addr, len, die_size);
 		if (ret)
 			goto erase_err;
diff --git a/drivers/mtd/spi-nor/core.h b/drivers/mtd/spi-nor/core.h
index e838c40a2589..30b965ccb44c 100644
--- a/drivers/mtd/spi-nor/core.h
+++ b/drivers/mtd/spi-nor/core.h
@@ -124,23 +124,22 @@
 /* Keep these in sync with the list in debugfs.c */
 enum spi_nor_option_flags {
 	SNOR_F_HAS_SR_TB	= BIT(0),
-	SNOR_F_NO_OP_CHIP_ERASE	= BIT(1),
-	SNOR_F_BROKEN_RESET	= BIT(2),
-	SNOR_F_4B_OPCODES	= BIT(3),
-	SNOR_F_HAS_4BAIT	= BIT(4),
-	SNOR_F_HAS_LOCK		= BIT(5),
-	SNOR_F_HAS_16BIT_SR	= BIT(6),
-	SNOR_F_NO_READ_CR	= BIT(7),
-	SNOR_F_HAS_SR_TB_BIT6	= BIT(8),
-	SNOR_F_HAS_4BIT_BP      = BIT(9),
-	SNOR_F_HAS_SR_BP3_BIT6  = BIT(10),
-	SNOR_F_IO_MODE_EN_VOLATILE = BIT(11),
-	SNOR_F_SOFT_RESET	= BIT(12),
-	SNOR_F_SWP_IS_VOLATILE	= BIT(13),
-	SNOR_F_RWW		= BIT(14),
-	SNOR_F_ECC		= BIT(15),
-	SNOR_F_NO_WP		= BIT(16),
-	SNOR_F_SWAP16		= BIT(17),
+	SNOR_F_BROKEN_RESET	= BIT(1),
+	SNOR_F_4B_OPCODES	= BIT(2),
+	SNOR_F_HAS_4BAIT	= BIT(3),
+	SNOR_F_HAS_LOCK		= BIT(4),
+	SNOR_F_HAS_16BIT_SR	= BIT(5),
+	SNOR_F_NO_READ_CR	= BIT(6),
+	SNOR_F_HAS_SR_TB_BIT6	= BIT(7),
+	SNOR_F_HAS_4BIT_BP      = BIT(8),
+	SNOR_F_HAS_SR_BP3_BIT6  = BIT(9),
+	SNOR_F_IO_MODE_EN_VOLATILE = BIT(10),
+	SNOR_F_SOFT_RESET	= BIT(11),
+	SNOR_F_SWP_IS_VOLATILE	= BIT(12),
+	SNOR_F_RWW		= BIT(13),
+	SNOR_F_ECC		= BIT(14),
+	SNOR_F_NO_WP		= BIT(15),
+	SNOR_F_SWAP16		= BIT(16),
 };
 
 struct spi_nor_read_command {
diff --git a/drivers/mtd/spi-nor/debugfs.c b/drivers/mtd/spi-nor/debugfs.c
index fa6956144d2e..7505cbab75d6 100644
--- a/drivers/mtd/spi-nor/debugfs.c
+++ b/drivers/mtd/spi-nor/debugfs.c
@@ -12,7 +12,6 @@
 #define SNOR_F_NAME(name) [ilog2(SNOR_F_##name)] = #name
 static const char *const snor_f_names[] = {
 	SNOR_F_NAME(HAS_SR_TB),
-	SNOR_F_NAME(NO_OP_CHIP_ERASE),
 	SNOR_F_NAME(BROKEN_RESET),
 	SNOR_F_NAME(4B_OPCODES),
 	SNOR_F_NAME(HAS_4BAIT),
@@ -136,10 +135,8 @@ static int spi_nor_params_show(struct seq_file *s, void *data)
 		}
 	}
 
-	if (!(nor->flags & SNOR_F_NO_OP_CHIP_ERASE)) {
-		string_get_size(params->size, 1, STRING_UNITS_2, buf, sizeof(buf));
-		seq_printf(s, " %02x (%s)\n", nor->params->die_erase_opcode, buf);
-	}
+	string_get_size(params->size, 1, STRING_UNITS_2, buf, sizeof(buf));
+	seq_printf(s, " %02x (%s)\n", nor->params->die_erase_opcode, buf);
 
 	seq_puts(s, "\nsector map\n");
 	seq_puts(s, " region (in hex)   | erase mask | overlaid\n");
-- 
2.43.0


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

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] mtd: spi-nor: remove unused NO_OP_CHIP_ERASE flag
  2026-04-16  9:03 [PATCH] mtd: spi-nor: remove unused NO_OP_CHIP_ERASE flag tkuw584924
@ 2026-04-16  9:15 ` Tudor Ambarus
  2026-04-16  9:32 ` Tudor Ambarus
  2026-04-16 10:46 ` Michael Walle
  2 siblings, 0 replies; 6+ messages in thread
From: Tudor Ambarus @ 2026-04-16  9:15 UTC (permalink / raw)
  To: tkuw584924, linux-mtd
  Cc: pratyush, mwalle, miquel.raynal, richard, vigneshr, Bacem.Daassi,
	Takahiro Kuwano


looks good. Please resubmit, this time including linux-kernel@vger.kernel.org
list as well, so that we benefit of the https://sashiko.dev/ 's review.

You use b4 to add the to/cc list automatically.


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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] mtd: spi-nor: remove unused NO_OP_CHIP_ERASE flag
  2026-04-16  9:03 [PATCH] mtd: spi-nor: remove unused NO_OP_CHIP_ERASE flag tkuw584924
  2026-04-16  9:15 ` Tudor Ambarus
@ 2026-04-16  9:32 ` Tudor Ambarus
  2026-04-16 10:46 ` Michael Walle
  2 siblings, 0 replies; 6+ messages in thread
From: Tudor Ambarus @ 2026-04-16  9:32 UTC (permalink / raw)
  To: tkuw584924, linux-mtd
  Cc: pratyush, mwalle, miquel.raynal, richard, vigneshr, Bacem.Daassi,
	Takahiro Kuwano


Reviewed-by: Tudor Ambarus <tudor.ambarus@linaro.org>

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] mtd: spi-nor: remove unused NO_OP_CHIP_ERASE flag
  2026-04-16  9:03 [PATCH] mtd: spi-nor: remove unused NO_OP_CHIP_ERASE flag tkuw584924
  2026-04-16  9:15 ` Tudor Ambarus
  2026-04-16  9:32 ` Tudor Ambarus
@ 2026-04-16 10:46 ` Michael Walle
  2026-04-17  0:27   ` Takahiro.Kuwano
  2 siblings, 1 reply; 6+ messages in thread
From: Michael Walle @ 2026-04-16 10:46 UTC (permalink / raw)
  To: tkuw584924, linux-mtd
  Cc: tudor.ambarus, pratyush, miquel.raynal, richard, vigneshr,
	Bacem.Daassi, Takahiro Kuwano


[-- Attachment #1.1: Type: text/plain, Size: 1649 bytes --]

Hi,

On Thu Apr 16, 2026 at 11:03 AM CEST, tkuw584924 wrote:
> --- a/drivers/mtd/spi-nor/core.h
> +++ b/drivers/mtd/spi-nor/core.h
> @@ -124,23 +124,22 @@
>  /* Keep these in sync with the list in debugfs.c */
>  enum spi_nor_option_flags {
>  	SNOR_F_HAS_SR_TB	= BIT(0),
> -	SNOR_F_NO_OP_CHIP_ERASE	= BIT(1),

Can we just drop this line and leave the rest as is? It's already
hard to follow any development in spi-nor due to code churn. I don't
think one hole in the flags hurts. The next new flag can then just
reuse it.

-michael

> -	SNOR_F_BROKEN_RESET	= BIT(2),
> -	SNOR_F_4B_OPCODES	= BIT(3),
> -	SNOR_F_HAS_4BAIT	= BIT(4),
> -	SNOR_F_HAS_LOCK		= BIT(5),
> -	SNOR_F_HAS_16BIT_SR	= BIT(6),
> -	SNOR_F_NO_READ_CR	= BIT(7),
> -	SNOR_F_HAS_SR_TB_BIT6	= BIT(8),
> -	SNOR_F_HAS_4BIT_BP      = BIT(9),
> -	SNOR_F_HAS_SR_BP3_BIT6  = BIT(10),
> -	SNOR_F_IO_MODE_EN_VOLATILE = BIT(11),
> -	SNOR_F_SOFT_RESET	= BIT(12),
> -	SNOR_F_SWP_IS_VOLATILE	= BIT(13),
> -	SNOR_F_RWW		= BIT(14),
> -	SNOR_F_ECC		= BIT(15),
> -	SNOR_F_NO_WP		= BIT(16),
> -	SNOR_F_SWAP16		= BIT(17),
> +	SNOR_F_BROKEN_RESET	= BIT(1),
> +	SNOR_F_4B_OPCODES	= BIT(2),
> +	SNOR_F_HAS_4BAIT	= BIT(3),
> +	SNOR_F_HAS_LOCK		= BIT(4),
> +	SNOR_F_HAS_16BIT_SR	= BIT(5),
> +	SNOR_F_NO_READ_CR	= BIT(6),
> +	SNOR_F_HAS_SR_TB_BIT6	= BIT(7),
> +	SNOR_F_HAS_4BIT_BP      = BIT(8),
> +	SNOR_F_HAS_SR_BP3_BIT6  = BIT(9),
> +	SNOR_F_IO_MODE_EN_VOLATILE = BIT(10),
> +	SNOR_F_SOFT_RESET	= BIT(11),
> +	SNOR_F_SWP_IS_VOLATILE	= BIT(12),
> +	SNOR_F_RWW		= BIT(13),
> +	SNOR_F_ECC		= BIT(14),
> +	SNOR_F_NO_WP		= BIT(15),
> +	SNOR_F_SWAP16		= BIT(16),

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 297 bytes --]

[-- Attachment #2: Type: text/plain, Size: 144 bytes --]

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* RE: [PATCH] mtd: spi-nor: remove unused NO_OP_CHIP_ERASE flag
  2026-04-16 10:46 ` Michael Walle
@ 2026-04-17  0:27   ` Takahiro.Kuwano
  2026-04-17  6:30     ` Michael Walle
  0 siblings, 1 reply; 6+ messages in thread
From: Takahiro.Kuwano @ 2026-04-17  0:27 UTC (permalink / raw)
  To: mwalle, tkuw584924, linux-mtd
  Cc: tudor.ambarus, pratyush, miquel.raynal, richard, vigneshr,
	Bacem.Daassi

> Hi,
> 
> On Thu Apr 16, 2026 at 11:03 AM CEST, tkuw584924 wrote:
> > --- a/drivers/mtd/spi-nor/core.h
> > +++ b/drivers/mtd/spi-nor/core.h
> > @@ -124,23 +124,22 @@
> >  /* Keep these in sync with the list in debugfs.c */
> >  enum spi_nor_option_flags {
> >  	SNOR_F_HAS_SR_TB	= BIT(0),
> > -	SNOR_F_NO_OP_CHIP_ERASE	= BIT(1),
> 
> Can we just drop this line and leave the rest as is? It's already
> hard to follow any development in spi-nor due to code churn. I don't
> think one hole in the flags hurts. The next new flag can then just
> reuse it.
> 
> -michael
> 
Sounds fine to me. With a placeholder like this?
/* NEW FLAG HERE : BIT(1) */

Thanks,
Takahiro

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] mtd: spi-nor: remove unused NO_OP_CHIP_ERASE flag
  2026-04-17  0:27   ` Takahiro.Kuwano
@ 2026-04-17  6:30     ` Michael Walle
  0 siblings, 0 replies; 6+ messages in thread
From: Michael Walle @ 2026-04-17  6:30 UTC (permalink / raw)
  To: Takahiro.Kuwano, tkuw584924, linux-mtd
  Cc: tudor.ambarus, pratyush, miquel.raynal, richard, vigneshr,
	Bacem.Daassi


[-- Attachment #1.1: Type: text/plain, Size: 898 bytes --]

On Fri Apr 17, 2026 at 2:27 AM CEST, Takahiro.Kuwano wrote:
>> Hi,
>> 
>> On Thu Apr 16, 2026 at 11:03 AM CEST, tkuw584924 wrote:
>> > --- a/drivers/mtd/spi-nor/core.h
>> > +++ b/drivers/mtd/spi-nor/core.h
>> > @@ -124,23 +124,22 @@
>> >  /* Keep these in sync with the list in debugfs.c */
>> >  enum spi_nor_option_flags {
>> >  	SNOR_F_HAS_SR_TB	= BIT(0),
>> > -	SNOR_F_NO_OP_CHIP_ERASE	= BIT(1),
>> 
>> Can we just drop this line and leave the rest as is? It's already
>> hard to follow any development in spi-nor due to code churn. I don't
>> think one hole in the flags hurts. The next new flag can then just
>> reuse it.
>> 
>> -michael
>> 
> Sounds fine to me. With a placeholder like this?
> /* NEW FLAG HERE : BIT(1) */

You could add a comment above the enum. Something like. "This could
contain holes, if adding a new flag use the first free spot." 

-michael

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 297 bytes --]

[-- Attachment #2: Type: text/plain, Size: 144 bytes --]

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2026-04-17  6:30 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-16  9:03 [PATCH] mtd: spi-nor: remove unused NO_OP_CHIP_ERASE flag tkuw584924
2026-04-16  9:15 ` Tudor Ambarus
2026-04-16  9:32 ` Tudor Ambarus
2026-04-16 10:46 ` Michael Walle
2026-04-17  0:27   ` Takahiro.Kuwano
2026-04-17  6:30     ` Michael Walle

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox