[openwrt/openwrt] lantiq: xrx200: handle EPROBE_DEFER for MAC address

LEDE Commits lede-commits at lists.infradead.org
Sun Feb 8 15:44:36 PST 2026


hauke pushed a commit to openwrt/openwrt.git, branch openwrt-25.12:
https://git.openwrt.org/d527d58cf817ead9118080b81f842007582194a7

commit d527d58cf817ead9118080b81f842007582194a7
Author: Burak Aydos <byhexadecimal at gmail.com>
AuthorDate: Tue Feb 3 23:38:01 2026 +0300

    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 at gmail.com>
    Link: https://github.com/openwrt/openwrt/pull/21861
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
    (cherry picked from commit 50e7e5c80d9269e7a6e947688ffb4cec895d1237)
---
 ...rx200-handle-EPROBE_DEFER-for-MAC-address.patch | 30 ++++++++++++++++++++++
 1 file changed, 30 insertions(+)

diff --git a/target/linux/lantiq/patches-6.12/0801-net-ethernet-lantiq-xrx200-handle-EPROBE_DEFER-for-MAC-address.patch b/target/linux/lantiq/patches-6.12/0801-net-ethernet-lantiq-xrx200-handle-EPROBE_DEFER-for-MAC-address.patch
new file mode 100644
index 0000000000..0d7ecd9bf8
--- /dev/null
+++ b/target/linux/lantiq/patches-6.12/0801-net-ethernet-lantiq-xrx200-handle-EPROBE_DEFER-for-MAC-address.patch
@@ -0,0 +1,30 @@
+From: Burak Aydos <byhexadecimal at gmail.com>
+Date: Mon, 03 Feb 2026 12:00:00 +0300
+Subject: [PATCH] net: ethernet: lantiq: xrx200: handle EPROBE_DEFER for MAC
+ address
+
+When the MAC address is provided by an nvmem layout driver (such as
+u-boot-env), the nvmem cell may not be available yet when the ethernet
+driver probes. In this case, of_get_ethdev_address() returns
+-EPROBE_DEFER to indicate the driver should be retried later.
+
+Currently the driver treats all errors equally and falls back to a
+random MAC address. Fix this by propagating EPROBE_DEFER so the
+driver probe is deferred until the nvmem cell becomes available.
+
+Signed-off-by: Burak Aydos <byhexadecimal at gmail.com>
+---
+ drivers/net/ethernet/lantiq_xrx200.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+--- a/drivers/net/ethernet/lantiq_xrx200.c
++++ b/drivers/net/ethernet/lantiq_xrx200.c
+@@ -597,6 +597,8 @@ static int xrx200_probe(struct platform_
+ 	}
+ 
+ 	err = of_get_ethdev_address(np, net_dev);
++	if (err == -EPROBE_DEFER)
++		return err;
+ 	if (err)
+ 		eth_hw_addr_random(net_dev);
+ 




More information about the lede-commits mailing list