Skip to content

Commit 50e7e5c

Browse files
bYHexadecimalhauke
authored andcommitted
lantiq: xrx200: handle EPROBE_DEFER for MAC address
The xrx200 ethernet driver falls back to a random MAC address on any error from of_get_ethdev_address(), including -EPROBE_DEFER. When the MAC address comes from an nvmem layout driver (such as u-boot-env on NAND), the nvmem cell may not be available yet at first probe attempt. Fix this by propagating EPROBE_DEFER so the driver probe is deferred until the nvmem cell becomes available. Tested on Zyxel P-2812HNU-F1 (NAND, u-boot-env nvmem layout). Signed-off-by: Burak Aydos <byhexadecimal@gmail.com> Link: openwrt/openwrt#21861 Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
1 parent 09de759 commit 50e7e5c

1 file changed

Lines changed: 30 additions & 0 deletions

File tree

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
From: Burak Aydos <byhexadecimal@gmail.com>
2+
Date: Mon, 03 Feb 2026 12:00:00 +0300
3+
Subject: [PATCH] net: ethernet: lantiq: xrx200: handle EPROBE_DEFER for MAC
4+
address
5+
6+
When the MAC address is provided by an nvmem layout driver (such as
7+
u-boot-env), the nvmem cell may not be available yet when the ethernet
8+
driver probes. In this case, of_get_ethdev_address() returns
9+
-EPROBE_DEFER to indicate the driver should be retried later.
10+
11+
Currently the driver treats all errors equally and falls back to a
12+
random MAC address. Fix this by propagating EPROBE_DEFER so the
13+
driver probe is deferred until the nvmem cell becomes available.
14+
15+
Signed-off-by: Burak Aydos <byhexadecimal@gmail.com>
16+
---
17+
drivers/net/ethernet/lantiq_xrx200.c | 2 ++
18+
1 file changed, 2 insertions(+)
19+
20+
--- a/drivers/net/ethernet/lantiq_xrx200.c
21+
+++ b/drivers/net/ethernet/lantiq_xrx200.c
22+
@@ -597,6 +597,8 @@ static int xrx200_probe(struct platform_
23+
}
24+
25+
err = of_get_ethdev_address(np, net_dev);
26+
+ if (err == -EPROBE_DEFER)
27+
+ return err;
28+
if (err)
29+
eth_hw_addr_random(net_dev);
30+

0 commit comments

Comments
 (0)