From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: Renaud Barbier <Renaud.Barbier@ametek.com>,
Barebox List <barebox@lists.infradead.org>
Subject: Re: ls1046a: fsl-fman failure
Date: Tue, 15 Jul 2025 22:20:12 +0200 [thread overview]
Message-ID: <9183ce45-f0c5-432f-b424-5dad3f5b03b5@pengutronix.de> (raw)
In-Reply-To: <DM5PR07MB3532E2B48E52ED710507A7B6EC57A@DM5PR07MB3532.namprd07.prod.outlook.com>
Hello Renaud,
Thanks for the report and your investigation and sorry for the breakage.
I just Cc'd you on a suggested fix.
Cheers,
Ahmad
On 15.07.25 17:04, Renaud Barbier wrote:
> I have recently moved to barebox v2025.06 and the ethernet driver is failing probing.
> In the COMMIT below, dev_get_drvdata is replaced by the following function device_get_match_data:
>
> const void *device_get_match_data(struct device *dev)
> {
> ~ if (dev->of_id_entry) {
> + pr_err("%s A0 return 0x%p\n", __func__, dev->of_id_entry->data);
> return dev->of_id_entry->data;
> + }
>
> ~ if (dev->id_entry) {
> + pr_err("%s A1 return 0x%p\n", __func__, dev->of_id_entry->data);
> return (void *)dev->id_entry->driver_data;
> + }
>
> + pr_err("%s return 0x%p\n", __func__, NULL);
> return NULL;
> }
>
> For my specific device, I get the following debug message:
> ERROR: fsl-fman-port 1a8b000.port@8b000.of: probe
> ERROR: device_get_match_data A0 return 0x0000000000000000 (here dev->of_id_entry is not NULL and dev->of_id_entry->data is returned)
>
> and from fsl_fman_port_probe:
> ERROR: fsl-fman-port 1a8b000.port@8b000.of: type = 0. This is a valid type: FMAN_PORT_TYPE_RX = 0
> ERROR: fsl-fman-port 1a8b000.port@8b000.of: out
>
> COMMIT:
> index f205de1929..84e7f20330 100644
> --- a/drivers/net/fsl-fman.c
> +++ b/drivers/net/fsl-fman.c
> @@ -1085,15 +1085,14 @@ static int fsl_fman_mdio_probe(struct device *dev)
> static int fsl_fman_port_probe(struct device *dev)
> {
> struct resource *iores;
> - int ret;
> struct fsl_fman_port *port;
> unsigned long type;
>
> dev_dbg(dev, "probe\n");
>
> - ret = dev_get_drvdata(dev, (const void **)&type);
> dev_err(dev, "type = %d\n", type); <==== type is 0 or 1 (FMAN_PORT_TYPE_RX or FMAN_PORT_TYPE_TX )
> - if (ret)
> - return ret;
> + type = (uintptr_t)device_get_match_data(dev);
> + if (!type) <==== HERE it bails out because type == 0
> dev_err(dev, "out\n"); **
> + return -ENODEV;
>
>
>
>
--
Pengutronix e.K. | |
Steuerwalder Str. 21 | http://www.pengutronix.de/ |
31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
prev parent reply other threads:[~2025-07-15 20:20 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-15 15:04 Renaud Barbier
2025-07-15 20:20 ` Ahmad Fatoum [this message]
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=9183ce45-f0c5-432f-b424-5dad3f5b03b5@pengutronix.de \
--to=a.fatoum@pengutronix.de \
--cc=Renaud.Barbier@ametek.com \
--cc=barebox@lists.infradead.org \
/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