All of lore.kernel.org
 help / color / mirror / Atom feed
From: Esben Haabendal <esben@geanix.com>
To: Tudor Ambarus <tudor.ambarus@linaro.org>
Cc: Pratyush Yadav <pratyush@kernel.org>,
	 Michael Walle <mwalle@kernel.org>,
	 Miquel Raynal <miquel.raynal@bootlin.com>,
	 Richard Weinberger <richard@nod.at>,
	 Vignesh Raghavendra <vigneshr@ti.com>,
	linux-mtd@lists.infradead.org,  linux-kernel@vger.kernel.org,
	 Rasmus Villemoes <rasmus.villemoes@prevas.dk>
Subject: Re: [PATCH v2 1/2] mtd: spi-nor: core: add flag for doing optional SFDP
Date: Thu, 06 Jun 2024 19:13:57 +0200	[thread overview]
Message-ID: <878qziat9m.fsf@geanix.com> (raw)
In-Reply-To: <a379a411-2c9e-4d9d-aa8f-4c4f3463cc27@linaro.org> (Tudor Ambarus's message of "Thu, 6 Jun 2024 14:31:22 +0100")

Tudor Ambarus <tudor.ambarus@linaro.org> writes:

> On 6/3/24 14:09, Esben Haabendal wrote:
>> A dedicated flag for triggering call to
>> spi_nor_sfdp_init_params_deprecated() allows enabling optional SFDP read
>> and parse, with fallback to legacy flash parameters, without having dual,
>> quad or octal parameters set in the legacy flash parameters.
>> 
>> With this, spi-nor flash parts without SFDP that is replaced with a
>> different flash NOR flash part that does have SFDP, but shares the same
>> manufacturer and device ID is easily handled.
>> 
>> Signed-off-by: Esben Haabendal <esben@geanix.com>
>> ---
>>  drivers/mtd/spi-nor/core.c | 3 ++-
>>  drivers/mtd/spi-nor/core.h | 1 +
>>  2 files changed, 3 insertions(+), 1 deletion(-)
>> 
>> diff --git a/drivers/mtd/spi-nor/core.c b/drivers/mtd/spi-nor/core.c
>> index 3e1f1913536b..1c4d66fc993b 100644
>> --- a/drivers/mtd/spi-nor/core.c
>> +++ b/drivers/mtd/spi-nor/core.c
>> @@ -2933,7 +2933,8 @@ static void spi_nor_init_params_deprecated(struct spi_nor *nor)
>>  
>>  	spi_nor_manufacturer_init_params(nor);
>>  
>> -	if (nor->info->no_sfdp_flags & (SPI_NOR_DUAL_READ |
>> +	if (nor->info->no_sfdp_flags & (SPI_NOR_TRY_SFDP |
>
> I don't like that we update deprecated methods. The solution though is
> elegant.

Maybe we should un-deprecate it? I don't understand why it should be
deprecated. It obviously has a valid purpose.

>> +					SPI_NOR_DUAL_READ |
>>  					SPI_NOR_QUAD_READ |
>>  					SPI_NOR_OCTAL_READ |
>>  					SPI_NOR_OCTAL_DTR_READ))
>> diff --git a/drivers/mtd/spi-nor/core.h b/drivers/mtd/spi-nor/core.h
>> index 442786685515..77f61a984cb3 100644
>> --- a/drivers/mtd/spi-nor/core.h
>> +++ b/drivers/mtd/spi-nor/core.h
>> @@ -535,6 +535,7 @@ struct flash_info {
>>  	u8 no_sfdp_flags;
>>  #define SPI_NOR_SKIP_SFDP		BIT(0)
>>  #define SECT_4K				BIT(1)
>> +#define SPI_NOR_TRY_SFDP		BIT(2)
>>  #define SPI_NOR_DUAL_READ		BIT(3)
>>  #define SPI_NOR_QUAD_READ		BIT(4)
>>  #define SPI_NOR_OCTAL_READ		BIT(5)
>> 

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

WARNING: multiple messages have this Message-ID (diff)
From: Esben Haabendal <esben@geanix.com>
To: Tudor Ambarus <tudor.ambarus@linaro.org>
Cc: Pratyush Yadav <pratyush@kernel.org>,
	 Michael Walle <mwalle@kernel.org>,
	 Miquel Raynal <miquel.raynal@bootlin.com>,
	 Richard Weinberger <richard@nod.at>,
	 Vignesh Raghavendra <vigneshr@ti.com>,
	linux-mtd@lists.infradead.org,  linux-kernel@vger.kernel.org,
	 Rasmus Villemoes <rasmus.villemoes@prevas.dk>
Subject: Re: [PATCH v2 1/2] mtd: spi-nor: core: add flag for doing optional SFDP
Date: Thu, 06 Jun 2024 19:13:57 +0200	[thread overview]
Message-ID: <878qziat9m.fsf@geanix.com> (raw)
In-Reply-To: <a379a411-2c9e-4d9d-aa8f-4c4f3463cc27@linaro.org> (Tudor Ambarus's message of "Thu, 6 Jun 2024 14:31:22 +0100")

Tudor Ambarus <tudor.ambarus@linaro.org> writes:

> On 6/3/24 14:09, Esben Haabendal wrote:
>> A dedicated flag for triggering call to
>> spi_nor_sfdp_init_params_deprecated() allows enabling optional SFDP read
>> and parse, with fallback to legacy flash parameters, without having dual,
>> quad or octal parameters set in the legacy flash parameters.
>> 
>> With this, spi-nor flash parts without SFDP that is replaced with a
>> different flash NOR flash part that does have SFDP, but shares the same
>> manufacturer and device ID is easily handled.
>> 
>> Signed-off-by: Esben Haabendal <esben@geanix.com>
>> ---
>>  drivers/mtd/spi-nor/core.c | 3 ++-
>>  drivers/mtd/spi-nor/core.h | 1 +
>>  2 files changed, 3 insertions(+), 1 deletion(-)
>> 
>> diff --git a/drivers/mtd/spi-nor/core.c b/drivers/mtd/spi-nor/core.c
>> index 3e1f1913536b..1c4d66fc993b 100644
>> --- a/drivers/mtd/spi-nor/core.c
>> +++ b/drivers/mtd/spi-nor/core.c
>> @@ -2933,7 +2933,8 @@ static void spi_nor_init_params_deprecated(struct spi_nor *nor)
>>  
>>  	spi_nor_manufacturer_init_params(nor);
>>  
>> -	if (nor->info->no_sfdp_flags & (SPI_NOR_DUAL_READ |
>> +	if (nor->info->no_sfdp_flags & (SPI_NOR_TRY_SFDP |
>
> I don't like that we update deprecated methods. The solution though is
> elegant.

Maybe we should un-deprecate it? I don't understand why it should be
deprecated. It obviously has a valid purpose.

>> +					SPI_NOR_DUAL_READ |
>>  					SPI_NOR_QUAD_READ |
>>  					SPI_NOR_OCTAL_READ |
>>  					SPI_NOR_OCTAL_DTR_READ))
>> diff --git a/drivers/mtd/spi-nor/core.h b/drivers/mtd/spi-nor/core.h
>> index 442786685515..77f61a984cb3 100644
>> --- a/drivers/mtd/spi-nor/core.h
>> +++ b/drivers/mtd/spi-nor/core.h
>> @@ -535,6 +535,7 @@ struct flash_info {
>>  	u8 no_sfdp_flags;
>>  #define SPI_NOR_SKIP_SFDP		BIT(0)
>>  #define SECT_4K				BIT(1)
>> +#define SPI_NOR_TRY_SFDP		BIT(2)
>>  #define SPI_NOR_DUAL_READ		BIT(3)
>>  #define SPI_NOR_QUAD_READ		BIT(4)
>>  #define SPI_NOR_OCTAL_READ		BIT(5)
>> 

  parent reply	other threads:[~2024-06-06 17:14 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-03 13:09 [PATCH v2 0/2] mtd: spi-nor: macronix: workaround for device id re-use Esben Haabendal
2024-06-03 13:09 ` Esben Haabendal
2024-06-03 13:09 ` [PATCH v2 1/2] mtd: spi-nor: core: add flag for doing optional SFDP Esben Haabendal
2024-06-03 13:09   ` Esben Haabendal
2024-06-06 13:31   ` Tudor Ambarus
2024-06-06 13:31     ` Tudor Ambarus
2024-06-06 13:59     ` Michael Walle
2024-06-06 13:59       ` Michael Walle
2024-06-06 14:52       ` Tudor Ambarus
2024-06-06 14:52         ` Tudor Ambarus
2024-06-06 15:06         ` Michael Walle
2024-06-06 15:06           ` Michael Walle
2024-06-06 17:20           ` Esben Haabendal
2024-06-06 17:20             ` Esben Haabendal
2024-06-07  9:22             ` Tudor Ambarus
2024-06-07  9:22               ` Tudor Ambarus
2024-06-07 13:30               ` Esben Haabendal
2024-06-07 13:30                 ` Esben Haabendal
2024-06-12  8:51                 ` Michael Walle
2024-06-12  8:51                   ` Michael Walle
2024-06-06 17:20         ` Esben Haabendal
2024-06-06 17:20           ` Esben Haabendal
2024-07-10 18:42       ` Esben Haabendal
2024-07-10 18:42         ` Esben Haabendal
2024-07-11  9:02         ` Michael Walle
2024-07-11  9:02           ` Michael Walle
2024-07-11 11:55           ` Esben Haabendal
2024-07-11 11:55             ` Esben Haabendal
2024-06-06 17:13     ` Esben Haabendal [this message]
2024-06-06 17:13       ` Esben Haabendal
2024-06-03 13:09 ` [PATCH v2 2/2] mtd: spi-nor: macronix: enable quad/dual speed for mx25l3205d chips Esben Haabendal
2024-06-03 13:09   ` Esben Haabendal
2024-06-06 13:33   ` Tudor Ambarus
2024-06-06 13:33     ` Tudor Ambarus
2024-06-06 17:23     ` Esben Haabendal
2024-06-06 17:23       ` Esben Haabendal

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=878qziat9m.fsf@geanix.com \
    --to=esben@geanix.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=miquel.raynal@bootlin.com \
    --cc=mwalle@kernel.org \
    --cc=pratyush@kernel.org \
    --cc=rasmus.villemoes@prevas.dk \
    --cc=richard@nod.at \
    --cc=tudor.ambarus@linaro.org \
    --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.