mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Guenter Roeck <linux@roeck-us.net>
To: Tudor Ambarus <tudor.ambarus@linaro.org>,
	Pratyush Yadav <pratyush@kernel.org>,
	Cheng Ming Lin <chengminglin@mxic.com.tw>
Cc: Cheng Ming Lin <linchengming884@gmail.com>,
	mwalle@kernel.org, miquel.raynal@bootlin.com, richard@nod.at,
	vigneshr@ti.com, linux-mtd@lists.infradead.org,
	linux-kernel@vger.kernel.org, alvinzhou@mxic.com.tw,
	leoyu@mxic.com.tw
Subject: Re: [PATCH v2 1/3] mtd: spi-nor: macronix: Drop the redundant flash info fields
Date: Tue, 10 Jun 2025 00:41:32 -0700	[thread overview]
Message-ID: <ff485da8-1a02-40a9-9286-94459e52b26c@roeck-us.net> (raw)
In-Reply-To: <aa2a4480-9b78-4ed9-8f9d-b18a87eb01e9@linaro.org>

On 6/9/25 23:46, Tudor Ambarus wrote:
> 
> 
> On 6/10/25 1:14 AM, Guenter Roeck wrote:
>> On 6/8/25 18:13, Guenter Roeck wrote:
>>> On 6/8/25 05:53, Pratyush Yadav wrote:
>>>> On Sat, Jun 07 2025, Guenter Roeck wrote:
>>>>
>>>>> Hi,
>>>>>
>>>>> On Mon, Apr 07, 2025 at 03:53:58PM +0800, Cheng Ming Lin wrote:
>>>>>> From: Cheng Ming Lin <chengminglin@mxic.com.tw>
>>>>>>
>>>>>> Many flash devices share the same ID but have different part numbers.
>>>>>> To avoid confusion, the part number field is removed.
>>>>>>
>>>>>> Additionally, since SFDP already provides size information and
>>>>>> functionality covered by no_sfdp_flags, these fields are also removed.
>>>>>>
>>>>>> Furthermore, when 4-byte address instruction table is available,
>>>>>> the SPI_NOR_4B_OPCODES flag is no longer needed and is removed.
>>>>>>
>>>>>> Signed-off-by: Cheng Ming Lin <chengminglin@mxic.com.tw>
>>>>>> Acked-by: Tudor Ambarus <tudor.ambarus@linaro.org>
>>>>>
>>>>> With this patch in place, some of my qemu tests no longer recognize the
>>>>> flash chips (MX25L25635E/F). Do you have a suggestion on how to handle
>>>>> this other than avoiding Macronix flash chips when working with qemu ?
>>>>
>>>> Could you share some logs? Does the flash fail to detect, or does the
>>>> SFDP-based probing fail? Since this is qemu, it would be even better if
>>>> you can share a setup/reproduction guide. I have been meaning to set up
>>>> qemu for SPI NOR testing for some time now, but never got around to
>>>> figuring it out.
>>>>
>>>
>>> I suspect that the SFDP data for the affected flashes is incorrect in
>>> qemu.
>>> Since this is very likely a qemu problem, I'll just configure
>>> different flash
>>> chips when running affected tests.
>>>
>>
>> I was able to confirm the above. This is from the kernel log:
>>
>> [    4.500000] spi-nor spi0.0: BFPT parsing failed. Please consider
>> using SPI_NOR_SKIP_SFDP when declaring the flash
>> [    4.500000] spi-nor spi0.0: probe with driver spi-nor failed with
>> error -22
>>
> 
> It's likely the problem where the same flash ID is used for different
> flavors of flashes. Typically we differentiate the flavors by comparing
> their SFDP data and use post SFDP hooks to amend where needed. If no one
> cares about fixing it, we can undo the change for the affected flash or
> revert the patch entirely. Cheng?
> 

Some debugging shows two problems with qemu: The returned SFPD data for one
of the flashes is wrong and does not reflect the data qemu is supposed
to provide, and qemu does not provide SFPD data for all flashes.

I don't know if the bad data is due to a bad Linux driver (unlikely), a bug
in qemu's SPI emulation code, or a bug in qemu's flash emulation code.
Unfortunately I don't really have time to track this down further.

Guenter


  parent reply	other threads:[~2025-06-10  7:41 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-07  7:53 [PATCH v2 0/3] mtd: spi-nor: macronix: Cleanup macronix flash info Cheng Ming Lin
2025-04-07  7:53 ` [PATCH v2 1/3] mtd: spi-nor: macronix: Drop the redundant flash info fields Cheng Ming Lin
2025-06-08  1:04   ` Guenter Roeck
2025-06-08 12:53     ` Pratyush Yadav
2025-06-09  1:13       ` Guenter Roeck
2025-06-10  0:14         ` Guenter Roeck
2025-06-10  6:46           ` Tudor Ambarus
2025-06-10  7:29             ` Cheng Ming Lin
2025-06-10  7:43               ` Guenter Roeck
2025-09-24 12:10               ` Michael Walle
2025-09-30  7:36                 ` Cheng Ming Lin
2025-09-30 12:19                   ` Pratyush Yadav
2025-09-30 13:15                     ` Maarten Zanders
2025-10-01  6:59                       ` Michael Walle
2025-09-30 14:39                     ` Guenter Roeck
2025-06-10  7:41             ` Guenter Roeck [this message]
2025-06-22 19:09               ` Pratyush Yadav
2025-10-01  9:35                 ` Cédric Le Goater
2025-04-07  7:53 ` [PATCH v2 2/3] mtd: spi-nor: macronix: Remove duplicate flash info entries Cheng Ming Lin
2025-04-07  7:54 ` [PATCH v2 3/3] mtd: spi-nor: macronix: Add fixups for MX25L3255E Cheng Ming Lin
2025-04-07  8:25   ` Cheng Ming Lin
2025-04-08 14:52   ` Pratyush Yadav
2025-05-06  9:36 ` [PATCH v2 0/3] mtd: spi-nor: macronix: Cleanup macronix flash info Pratyush Yadav

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=ff485da8-1a02-40a9-9286-94459e52b26c@roeck-us.net \
    --to=linux@roeck-us.net \
    --cc=alvinzhou@mxic.com.tw \
    --cc=chengminglin@mxic.com.tw \
    --cc=leoyu@mxic.com.tw \
    --cc=linchengming884@gmail.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=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 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®