* [PATCH net] net: ixp4xx_eth: handle probe deferral from of_get_mac_address()
@ 2026-08-27 1:36 Rosen Penev
2026-08-27 7:03 ` Linus Walleij
2026-09-01 0:08 ` Jakub Kicinski
0 siblings, 2 replies; 3+ messages in thread
From: Rosen Penev @ 2026-08-27 1:36 UTC (permalink / raw)
To: netdev
Cc: Linus Walleij, Imre Kaloz, Andrew Lunn, David S. Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni,
moderated list:ARM/INTEL IXP4XX ARM ARCHITECTURE, open list
ixp4xx_of_get_platdata() returns NULL on failure, which the probe converts
to -ENODEV, discarding the real cause of the failure. Return ERR_PTR()
with the appropriate error so callers can distinguish cases such as
missing DT properties (-EINVAL) and, importantly, handle -EPROBE_DEFER
from of_get_mac_address().
Fixes: 95aafe911db6 ("net: ethernet: ixp4xx: Support device tree probing")
Assisted-by: opencode:hy3-free
Signed-off-by: Rosen Penev <rosenp@gmail.com>
---
drivers/net/ethernet/xscale/ixp4xx_eth.c | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
diff --git a/drivers/net/ethernet/xscale/ixp4xx_eth.c b/drivers/net/ethernet/xscale/ixp4xx_eth.c
index b0faa0f1780d..b8889f87ca03 100644
--- a/drivers/net/ethernet/xscale/ixp4xx_eth.c
+++ b/drivers/net/ethernet/xscale/ixp4xx_eth.c
@@ -1444,13 +1444,13 @@ static struct eth_plat_info *ixp4xx_of_get_platdata(struct device *dev)
plat = devm_kzalloc(dev, sizeof(*plat), GFP_KERNEL);
if (!plat)
- return NULL;
+ return ERR_PTR(-ENOMEM);
ret = of_parse_phandle_with_fixed_args(np, "intel,npe-handle", 1, 0,
&npe_spec);
if (ret) {
dev_err(dev, "no NPE engine specified\n");
- return NULL;
+ return ERR_PTR(-EINVAL);
}
/* NPE ID 0x00, 0x10, 0x20... */
plat->npe = (npe_spec.args[0] << 4);
@@ -1468,7 +1468,7 @@ static struct eth_plat_info *ixp4xx_of_get_platdata(struct device *dev)
&queue_spec);
if (ret) {
dev_err(dev, "no rx queue phandle\n");
- return NULL;
+ return ERR_PTR(-EINVAL);
}
plat->rxq = queue_spec.args[0];
@@ -1477,11 +1477,13 @@ static struct eth_plat_info *ixp4xx_of_get_platdata(struct device *dev)
&queue_spec);
if (ret) {
dev_err(dev, "no txready queue phandle\n");
- return NULL;
+ return ERR_PTR(-EINVAL);
}
plat->txreadyq = queue_spec.args[0];
ret = of_get_mac_address(np, mac);
+ if (ret == -EPROBE_DEFER)
+ return ERR_PTR(ret);
if (!ret) {
dev_info(dev, "Setting macaddr from DT %pM\n", mac);
memcpy(plat->hwaddr, mac, ETH_ALEN);
@@ -1501,8 +1503,8 @@ static int ixp4xx_eth_probe(struct platform_device *pdev)
int err;
plat = ixp4xx_of_get_platdata(dev);
- if (!plat)
- return -ENODEV;
+ if (IS_ERR(plat))
+ return PTR_ERR(plat);
if (!(ndev = devm_alloc_etherdev(dev, sizeof(struct port))))
return -ENOMEM;
--
2.55.0
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH net] net: ixp4xx_eth: handle probe deferral from of_get_mac_address()
2026-08-27 1:36 [PATCH net] net: ixp4xx_eth: handle probe deferral from of_get_mac_address() Rosen Penev
@ 2026-08-27 7:03 ` Linus Walleij
2026-09-01 0:08 ` Jakub Kicinski
1 sibling, 0 replies; 3+ messages in thread
From: Linus Walleij @ 2026-08-27 7:03 UTC (permalink / raw)
To: Rosen Penev
Cc: netdev, Imre Kaloz, Andrew Lunn, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni,
moderated list:ARM/INTEL IXP4XX ARM ARCHITECTURE, open list
On Thu, Aug 27, 2026 at 3:36 AM Rosen Penev <rosenp@gmail.com> wrote:
> ixp4xx_of_get_platdata() returns NULL on failure, which the probe converts
> to -ENODEV, discarding the real cause of the failure. Return ERR_PTR()
> with the appropriate error so callers can distinguish cases such as
> missing DT properties (-EINVAL) and, importantly, handle -EPROBE_DEFER
> from of_get_mac_address().
>
> Fixes: 95aafe911db6 ("net: ethernet: ixp4xx: Support device tree probing")
> Assisted-by: opencode:hy3-free
> Signed-off-by: Rosen Penev <rosenp@gmail.com>
Reviewed-by: Linus Walleij <linusw@kernel.org>
Thanks Rosen!
Linus Walleij
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH net] net: ixp4xx_eth: handle probe deferral from of_get_mac_address()
2026-08-27 1:36 [PATCH net] net: ixp4xx_eth: handle probe deferral from of_get_mac_address() Rosen Penev
2026-08-27 7:03 ` Linus Walleij
@ 2026-09-01 0:08 ` Jakub Kicinski
1 sibling, 0 replies; 3+ messages in thread
From: Jakub Kicinski @ 2026-09-01 0:08 UTC (permalink / raw)
To: Rosen Penev
Cc: netdev, Linus Walleij, Imre Kaloz, Andrew Lunn, David S. Miller,
Eric Dumazet, Paolo Abeni,
moderated list:ARM/INTEL IXP4XX ARM ARCHITECTURE, open list
On Wed, 26 Aug 2026 18:36:34 -0700 Rosen Penev wrote:
> ixp4xx_of_get_platdata() returns NULL on failure, which the probe converts
> to -ENODEV, discarding the real cause of the failure. Return ERR_PTR()
> with the appropriate error so callers can distinguish cases such as
> missing DT properties (-EINVAL) and, importantly, handle -EPROBE_DEFER
> from of_get_mac_address().
Doesn't seem like this should be treated as a fix, AI says:
Can a device tree that actually reaches this new code path pass
dtbs_check? -EPROBE_DEFER out of of_get_mac_address() only comes from
the nvmem lookup:
net/core/of_net.c:of_get_mac_address() {
...
return of_get_mac_address_nvmem(np, addr);
}
which needs nvmem-cells and nvmem-cell-names = "mac-address" in the node.
Documentation/devicetree/bindings/net/intel,ixp4xx-ethernet.yaml ends with
additionalProperties: false and pulls in ethernet-controller.yaml only via
allOf/$ref, re-listing just phy-mode, phy-handle and fixed-link. It never
lists nvmem-cells, nvmem-cell-names, mac-address or local-mac-address.
Should the binding gain those properties (or switch to
unevaluatedProperties: false) so the configuration this patch handles
can be described?
And if this goes to net-next there's a bunch of pre-existing
bugs in the area which will conflict, so frankly let's just leave
this be.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-09-01 0:09 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-08-27 1:36 [PATCH net] net: ixp4xx_eth: handle probe deferral from of_get_mac_address() Rosen Penev
2026-08-27 7:03 ` Linus Walleij
2026-09-01 0:08 ` Jakub Kicinski
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®