[openwrt/openwrt] lantiq: handle EPROBE_DEFER for MAC

LEDE Commits lede-commits at lists.infradead.org
Mon Feb 16 16:48:56 PST 2026


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

commit d66fc6e86fce3f9f7e2b78f254388c8c39e3ac27
Author: Rosen Penev <rosenp at gmail.com>
AuthorDate: Mon Feb 9 11:40:51 2026 -0800

    lantiq: handle EPROBE_DEFER for MAC
    
    If nvmem is used for ethernet mac address, we need to defer loading to
    get the proper mac.
    
    Signed-off-by: Rosen Penev <rosenp at gmail.com>
    Link: https://github.com/openwrt/openwrt/pull/21955
    Signed-off-by: Robert Marko <robimarko at gmail.com>
    (cherry picked from commit fb71774232871e7272bf15950c4a08f2a8395b87)
---
 .../patches-6.12/028-NET-lantiq-various-etop-fixes.patch   | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/target/linux/lantiq/patches-6.12/028-NET-lantiq-various-etop-fixes.patch b/target/linux/lantiq/patches-6.12/028-NET-lantiq-various-etop-fixes.patch
index fff60cefaf..9a0fdfd175 100644
--- a/target/linux/lantiq/patches-6.12/028-NET-lantiq-various-etop-fixes.patch
+++ b/target/linux/lantiq/patches-6.12/028-NET-lantiq-various-etop-fixes.patch
@@ -767,7 +767,7 @@ Signed-off-by: John Crispin <blogic at openwrt.org>
  
  	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
  	if (!res) {
-@@ -671,18 +873,54 @@ ltq_etop_probe(struct platform_device *p
+@@ -671,18 +873,60 @@ ltq_etop_probe(struct platform_device *p
  		goto err_out;
  	}
  
@@ -806,7 +806,13 @@ Signed-off-by: John Crispin <blogic at openwrt.org>
 +	if (err)
 +		pr_err("Can't find phy-mode for port\n");
 +
-+	of_get_mac_address(pdev->dev.of_node, priv->mac);
++	err = of_get_mac_address(pdev->dev.of_node, priv->mac);
++	if (err == -EPROBE_DEFER)
++		goto err_out;
++	if (err) {
++		eth_hw_addr_random(dev);
++		dev_err(&pdev->dev, "generated random MAC address %pM\n", priv->mac);
++	}
 +
 +	priv->clk_ppe = clk_get(&pdev->dev, NULL);
 +	if (IS_ERR(priv->clk_ppe))
@@ -828,7 +834,7 @@ Signed-off-by: John Crispin <blogic at openwrt.org>
  	spin_lock_init(&priv->lock);
  	SET_NETDEV_DEV(dev, &pdev->dev);
  
-@@ -698,15 +936,10 @@ ltq_etop_probe(struct platform_device *p
+@@ -698,15 +942,10 @@ ltq_etop_probe(struct platform_device *p
  		goto err_free;
  	}
  
@@ -848,7 +854,7 @@ Signed-off-by: John Crispin <blogic at openwrt.org>
  
  	err = register_netdev(dev);
  	if (err)
-@@ -733,31 +966,22 @@ static void ltq_etop_remove(struct platf
+@@ -733,31 +972,22 @@ static void ltq_etop_remove(struct platf
  	}
  }
  




More information about the lede-commits mailing list