All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pratyush Yadav <pratyush@kernel.org>
To: Guenter Roeck <linux@roeck-us.net>
Cc: Tudor Ambarus <tudor.ambarus@linaro.org>,
	 Pratyush Yadav <pratyush@kernel.org>,
	 Cheng Ming Lin <chengminglin@mxic.com.tw>,
	 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,
	Linus Torvalds <torvalds@linux-foundation.org>
Subject: Re: [PATCH v2 1/3] mtd: spi-nor: macronix: Drop the redundant flash info fields
Date: Sun, 22 Jun 2025 21:09:01 +0200	[thread overview]
Message-ID: <mafs01prbvbjm.fsf@kernel.org> (raw)
In-Reply-To: <ff485da8-1a02-40a9-9286-94459e52b26c@roeck-us.net>

Hi Guenter,

On Tue, Jun 10 2025, Guenter Roeck wrote:

> 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:
[...]
>>>>>> 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.
>>>>
[...]
>
> 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.

I used the command you posted in [0] and tried to reproduce the bug, but
for me the flash probes just fine:

    root@romulus:/sys/bus/spi/devices/spi0.0/spi-nor# cat manufacturer 
    macronix
    root@romulus:/sys/bus/spi/devices/spi0.0/spi-nor# cat jedec_id 
    c22019
    root@romulus:/sys/bus/spi/devices/spi0.0/spi-nor# uname -a
    Linux romulus 6.16.0-rc2-00308-gf7301f856d35-dirty #5 SMP Sat Jun 21 19:29:15 CEST 2025 armv6l GNU/Linux

The rootfs is also mounted on a mtdblock device backed by this flash,
and everything appears to work fine.

Which version of qemu are you using? I can see that SFDP data for
mx25l25635e was added to qemu in commit dc907a667c ("m25p80: Add the
mx25l25635e SFPD table"), which was released in v7.2.0. Older versions
of qemu might run into trouble with this flash if SFDP data is not
available.

FWIW, my qemu version:

    $ qemu-system-arm --version
    QEMU emulator version 10.0.0
    Copyright (c) 2003-2025 Fabrice Bellard and the QEMU Project developers

[0] https://lore.kernel.org/linux-mtd/da58fc81-3c99-4951-85bc-e3c139283b5a@roeck-us.net/

-- 
Regards,
Pratyush Yadav

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

WARNING: multiple messages have this Message-ID (diff)
From: Pratyush Yadav <pratyush@kernel.org>
To: Guenter Roeck <linux@roeck-us.net>
Cc: Tudor Ambarus <tudor.ambarus@linaro.org>,
	 Pratyush Yadav <pratyush@kernel.org>,
	 Cheng Ming Lin <chengminglin@mxic.com.tw>,
	 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,
	Linus Torvalds <torvalds@linux-foundation.org>
Subject: Re: [PATCH v2 1/3] mtd: spi-nor: macronix: Drop the redundant flash info fields
Date: Sun, 22 Jun 2025 21:09:01 +0200	[thread overview]
Message-ID: <mafs01prbvbjm.fsf@kernel.org> (raw)
In-Reply-To: <ff485da8-1a02-40a9-9286-94459e52b26c@roeck-us.net>

Hi Guenter,

On Tue, Jun 10 2025, Guenter Roeck wrote:

> 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:
[...]
>>>>>> 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.
>>>>
[...]
>
> 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.

I used the command you posted in [0] and tried to reproduce the bug, but
for me the flash probes just fine:

    root@romulus:/sys/bus/spi/devices/spi0.0/spi-nor# cat manufacturer 
    macronix
    root@romulus:/sys/bus/spi/devices/spi0.0/spi-nor# cat jedec_id 
    c22019
    root@romulus:/sys/bus/spi/devices/spi0.0/spi-nor# uname -a
    Linux romulus 6.16.0-rc2-00308-gf7301f856d35-dirty #5 SMP Sat Jun 21 19:29:15 CEST 2025 armv6l GNU/Linux

The rootfs is also mounted on a mtdblock device backed by this flash,
and everything appears to work fine.

Which version of qemu are you using? I can see that SFDP data for
mx25l25635e was added to qemu in commit dc907a667c ("m25p80: Add the
mx25l25635e SFPD table"), which was released in v7.2.0. Older versions
of qemu might run into trouble with this flash if SFDP data is not
available.

FWIW, my qemu version:

    $ qemu-system-arm --version
    QEMU emulator version 10.0.0
    Copyright (c) 2003-2025 Fabrice Bellard and the QEMU Project developers

[0] https://lore.kernel.org/linux-mtd/da58fc81-3c99-4951-85bc-e3c139283b5a@roeck-us.net/

-- 
Regards,
Pratyush Yadav

  reply	other threads:[~2025-06-22 19:09 UTC|newest]

Thread overview: 46+ 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 ` 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-04-07  7:53   ` Cheng Ming Lin
2025-06-08  1:04   ` Guenter Roeck
2025-06-08  1:04     ` Guenter Roeck
2025-06-08 12:53     ` Pratyush Yadav
2025-06-08 12:53       ` Pratyush Yadav
2025-06-09  1:13       ` Guenter Roeck
2025-06-09  1:13         ` Guenter Roeck
2025-06-10  0:14         ` Guenter Roeck
2025-06-10  0:14           ` Guenter Roeck
2025-06-10  6:46           ` Tudor Ambarus
2025-06-10  6:46             ` Tudor Ambarus
2025-06-10  7:29             ` Cheng Ming Lin
2025-06-10  7:29               ` Cheng Ming Lin
2025-06-10  7:43               ` Guenter Roeck
2025-06-10  7:43                 ` Guenter Roeck
2025-09-24 12:10               ` Michael Walle
2025-09-24 12:10                 ` Michael Walle
2025-09-30  7:36                 ` Cheng Ming Lin
2025-09-30  7:36                   ` Cheng Ming Lin
2025-09-30 12:19                   ` Pratyush Yadav
2025-09-30 12:19                     ` Pratyush Yadav
2025-09-30 13:15                     ` Maarten Zanders
2025-09-30 13:15                       ` Maarten Zanders
2025-10-01  6:59                       ` Michael Walle
2025-10-01  6:59                         ` Michael Walle
2025-09-30 14:39                     ` Guenter Roeck
2025-09-30 14:39                       ` Guenter Roeck
2025-06-10  7:41             ` Guenter Roeck
2025-06-10  7:41               ` Guenter Roeck
2025-06-22 19:09               ` Pratyush Yadav [this message]
2025-06-22 19:09                 ` Pratyush Yadav
2025-10-01  9:35                 ` Cédric Le Goater
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:53   ` 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  7:54   ` Cheng Ming Lin
2025-04-07  8:25   ` Cheng Ming Lin
2025-04-07  8:25     ` Cheng Ming Lin
2025-04-08 14:52   ` Pratyush Yadav
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
2025-05-06  9:36   ` 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=mafs01prbvbjm.fsf@kernel.org \
    --to=pratyush@kernel.org \
    --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=linux@roeck-us.net \
    --cc=miquel.raynal@bootlin.com \
    --cc=mwalle@kernel.org \
    --cc=richard@nod.at \
    --cc=torvalds@linux-foundation.org \
    --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.