mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Tudor Ambarus <tudor.ambarus@linaro.org>
To: Esben Haabendal <esben@geanix.com>, Michael Walle <mwalle@kernel.org>
Cc: Pratyush Yadav <pratyush@kernel.org>,
	Miquel Raynal <miquel.raynal@bootlin.com>,
	Richard Weinberger <richard@nod.at>,
	Vignesh Raghavendra <vigneshr@ti.com>,
	Nicolas Ferre <nicolas.ferre@microchip.com>,
	Alexandre Belloni <alexandre.belloni@bootlin.com>,
	Claudiu Beznea <claudiu.beznea@tuxon.dev>,
	linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org,
	Rasmus Villemoes <rasmus.villemoes@prevas.dk>,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v3 00/15] mtd: spi-nor: macronix: workaround for device id re-use
Date: Thu, 26 Sep 2024 11:52:25 +0100	[thread overview]
Message-ID: <2a38f567-8734-4295-95bd-c3ea65c0754b@linaro.org> (raw)
In-Reply-To: <2196b4e8-2c93-4a73-a717-28448d4668ab@linaro.org>



On 9/26/24 11:47 AM, Tudor Ambarus wrote:
> Hi, Esben,
> 
> Thank you for the perseverance :D
> 
> On 9/26/24 8:56 AM, Esben Haabendal wrote:
>> "Michael Walle" <mwalle@kernel.org> writes:
>>
>>> Hi,
>>>
>>> On Thu Jul 11, 2024 at 3:00 PM CEST, Esben Haabendal wrote:
>>>> As a consequence, the SPI_NOR_SKIP_SFDP flag is no more, and all
>>>> drivers that have been doing optional SFDP is now marked explicitly to
>>>> do that using the SPI_NOR_TRY_SFDP.
>>>
>>> First, I haven't looked at your patchset at the moment. But I'd like
>>> to take the opportunity to discuss the following (and excuse me that
>>> I didn't had this idea before all your work on this).
>>>
>>> First, I'd like to see it the other way around, that is, doing SFDP
>>> by default and let the driver opt-out instead of opt-in. This will
>>> also align with the current "SFDP only driver", i.e. if a flash is
>>> not known we try SFDP anyway. Going forward, I'd say this is also
>>> the sane behavior and we don't have to add any flags if someone want
>>> to add support for an (older) flash with the same ID but without
>>> SFDP. With the current approach, we'd have to add the TRY_SFDP flag.
>>>
>>> Now we might play it safe and add that SPI_NOR_SKIP_SFDP to any
>>> flash which doesn't do the SFDP parsing (because it has size != 0
>>> and not any of the magic flags set) - or we might just go ahead and
>>> do the probing first for *any* flashes. Yes we might issue an
>>> unsupported opcode, but we already do that with the generic SFDP
>>> flash driver. So no big deal maybe (?). Vendors where we know for a
>>> fact that they don't have any SFDP (Everspin I'm looking at you),
>>> would of course set the SKIP_SFDP flag.
> 
> Issuing RDSFDP for flashes that don't support it shouldn't be too bad
> indeed, it's not recommended, but it shall be fine. What I'm worried
> about is flashes with wrong SFDP data (see all the SFDP fixup hooks that
> we have). So my suggestion is to play it safe unless one of you guys
> step up and commit that will fix or help fix each bug that results from
> this.
> 
> I'd like you to also consider the SFDP versions and how many parameters
> they are exposing. I can't tell exactly, but if I remember correctly,
> rev A had 9 dwords for BFPT, revB 16, and revC and other more. If we
> consider static init folowed by SFDP with rollback option, point 3/ in
> your cover letter, are we sure that all the parameters that are
> initialized before parsing SFDP are overwritten at SFDP parsing time? If
> yes, we shall be fine.
> 
> Esben, to speed up the things on both ends, I recommend you for v4 to
> draft just a core patch if you care, then you can handle the vendor
> drivers. Or send us some pseudocode and we can talk on that.
> 

To summarize, I like the idea too, as far as we can keep backward
compatibility.

  reply	other threads:[~2024-09-26 10:52 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-11 13:00 Esben Haabendal
2024-07-11 13:00 ` [PATCH v3 01/15] mtd: spi-nor: core: add flag for doing optional SFDP parsing Esben Haabendal
2024-07-11 13:00 ` [PATCH v3 02/15] mtd: spi-nor: macronix: enable quad/dual speed for mx25l3205d chips Esben Haabendal
2024-07-11 13:00 ` [PATCH v3 03/15] mtd: spi-nor: Align default_init() handling for SPI_NOR_SKIP_SFDP Esben Haabendal
2024-07-11 13:00 ` [PATCH v3 04/15] mtd: spi-nor: atmel: Use new SPI_NOR_TRY_SFDP flag Esben Haabendal
2024-07-11 13:00 ` [PATCH v3 05/15] mtd: spi-nor: eon: " Esben Haabendal
2024-07-11 13:00 ` [PATCH v3 06/15] mtd: spi-nor: gigadevice: " Esben Haabendal
2024-07-11 13:00 ` [PATCH v3 07/15] mtd: spi-nor: issi: " Esben Haabendal
2024-07-11 13:00 ` [PATCH v3 08/15] mtd: spi-nor: macronix: " Esben Haabendal
2024-07-11 13:00 ` [PATCH v3 09/15] mtd: spi-nor: micron-st: " Esben Haabendal
2024-07-11 13:00 ` [PATCH v3 10/15] mtd: spi-nor: spansion: " Esben Haabendal
2024-07-11 13:00 ` [PATCH v3 11/15] mtd: spi-nor: sst: " Esben Haabendal
2024-07-11 13:00 ` [PATCH v3 12/15] mtd: spi-nor: winbond: " Esben Haabendal
2024-07-11 13:00 ` [PATCH v3 13/15] mtd: spi-nor: xmc: " Esben Haabendal
2024-07-11 13:00 ` [PATCH v3 14/15] mtd: spi-nor: Drop deprecated mechanism for optional SFDP parsing Esben Haabendal
2024-07-12  8:33   ` kernel test robot
2024-07-12  9:23   ` Esben Haabendal
2024-07-12 16:04   ` kernel test robot
2024-07-11 13:00 ` [PATCH v3 15/15] mtd: spi-nor: spansion: Drop redundant SPI_NOR_SKIP_SFDP flag Esben Haabendal
2024-07-12  9:26   ` Esben Haabendal
2024-07-12  9:55 ` [PATCH v3 00/15] mtd: spi-nor: macronix: workaround for device id re-use Michael Walle
2024-09-26  7:56   ` Esben Haabendal
2024-09-26 10:47     ` Tudor Ambarus
2024-09-26 10:52       ` Tudor Ambarus [this message]
2024-09-26 12:18       ` Esben Haabendal
2024-09-26 10:08 ` Tudor Ambarus
2024-09-26 11:01   ` Esben Haabendal
2024-09-26 11:35   ` 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=2a38f567-8734-4295-95bd-c3ea65c0754b@linaro.org \
    --to=tudor.ambarus@linaro.org \
    --cc=alexandre.belloni@bootlin.com \
    --cc=claudiu.beznea@tuxon.dev \
    --cc=esben@geanix.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=miquel.raynal@bootlin.com \
    --cc=mwalle@kernel.org \
    --cc=nicolas.ferre@microchip.com \
    --cc=pratyush@kernel.org \
    --cc=rasmus.villemoes@prevas.dk \
    --cc=richard@nod.at \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®