Thread (10 messages) 10 messages, 3 authors, 2025-09-03

Re: [PATCH net-next v14 2/5] net: ti: icssm-prueth: Adds ICSSM Ethernet driver

From: Anwar, Md Danish <hidden>
Date: 2025-09-01 14:53:05
Also in: linux-devicetree, lkml, netdev

Hi Parvathi,

On 8/22/2025 6:55 PM, Parvathi Pudi wrote:
From: Roger Quadros <redacted>

Updates Kernel configuration to enable PRUETH driver and its dependencies
along with makefile changes to add the new PRUETH driver.

Changes includes init and deinit of ICSSM PRU Ethernet driver including
net dev registration and firmware loading for DUAL-MAC mode running on
PRU-ICSS2 instance.

Changes also includes link handling, PRU booting, default firmware loading
and PRU stopping using existing remoteproc driver APIs.

Signed-off-by: Roger Quadros <redacted>
Signed-off-by: Andrew F. Davis <redacted>
Signed-off-by: Basharath Hussain Khaja <redacted>
Signed-off-by: Parvathi Pudi <parvathi@couthit.com>
[ ... ]
+	/* get mac address from DT and set private and netdev addr */
+	ret = of_get_ethdev_address(eth_node, ndev);
+	if (!is_valid_ether_addr(ndev->dev_addr)) {
+		eth_hw_addr_random(ndev);
+		dev_warn(prueth->dev, "port %d: using random MAC addr: %pM\n",
+			 port, ndev->dev_addr);
+	}
+	ether_addr_copy(emac->mac_addr, ndev->dev_addr);
+
+	/* connect PHY */
+	emac->phydev = of_phy_get_and_connect(ndev, eth_node,
+					      icssm_emac_adjust_link);
+	if (!emac->phydev) {
+		dev_dbg(prueth->dev, "PHY connection failed\n");
+		ret = -EPROBE_DEFER;
+		goto free;
+	}
+
Why are you returning EPROBE_DEFER here? If phy connection fails, you
should just return and fail the probe. That's what ICSSG driver does.

In drivers/net/ethernet/ti/icssg/icssg_prueth.c

 404   │     ndev->phydev = of_phy_connect(emac->ndev, emac->phy_node,
 405   │                       &emac_adjust_link, 0,
 406   │                       emac->phy_if);
 407   │     if (!ndev->phydev) {
 408   │         dev_err(prueth->dev, "couldn't connect to phy %s\n",
 409   │             emac->phy_node->full_name);
 410   │         return -ENODEV;
 411   │     }


Before phy connect you do `dev_warn(prueth->dev, "port %d: using random
MAC addr: %pM\n"`

If device is using random mac address, this will be printed, your phy
connect fails, you try probe again, print comes again, phy fails again
and so on ...

This results in system getting spammed with continuos prints of "using
random MAC addr"

I suggest if phy fails, let the probe fail don't do EPROBE_DEFER.

Saw this issue on few boards which has issue with ICSSG phy.
+	/* remove unsupported modes */
+	phy_remove_link_mode(emac->phydev, ETHTOOL_LINK_MODE_10baseT_Full_BIT);
-- 
Thanks and Regards,
Md Danish Anwar

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help