mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Renaud Barbier <Renaud.Barbier@ametek.com>
To: Barebox List <barebox@lists.infradead.org>
Subject: ls1046a: fsl-fman failure
Date: Tue, 15 Jul 2025 15:04:56 +0000	[thread overview]
Message-ID: <DM5PR07MB3532E2B48E52ED710507A7B6EC57A@DM5PR07MB3532.namprd07.prod.outlook.com> (raw)

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;

 
 


             reply	other threads:[~2025-07-15 19:15 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-15 15:04 Renaud Barbier [this message]
2025-07-15 20:20 ` Ahmad Fatoum

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=DM5PR07MB3532E2B48E52ED710507A7B6EC57A@DM5PR07MB3532.namprd07.prod.outlook.com \
    --to=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