Thread (6 messages) flat view 6 messages, 2 authors, 2025-12-04

Re: [PATCH net-next 1/3] net: stmmac: add physical port identification support

From: "Russell King (Oracle)" <linux@armlinux.org.uk>
Date: 2025-12-04 16:55:11
Also in: linux-devicetree, linux-renesas-soc

On Thu, Dec 04, 2025 at 04:31:20PM +0000, John Madieu wrote:
+static int stmmac_get_phys_port_name(struct net_device *dev,
+				     char *name, size_t len)
+{
+	struct stmmac_priv *priv = netdev_priv(dev);
+
+	/* Allow glue driver to override */
+	if (priv->plat->get_phys_port_name)
+		return priv->plat->get_phys_port_name(dev, name, len);
+
+	/* Default: use bus_id as port identifier */
+	return snprintf(name, len, "p%d", priv->plat->bus_id) >= len ? -EINVAL : 0;
priv->plat->bus_id may not be stable - for example, if a SoC describes
two stmmac ethernet, but omits the ethernet aliases, then plat->bus_id
is assigned in order that stmmac_probe_config_dt() is called for each
device.

How important is it that the phys_port_name is stable across boots?
If it should be stable, then I think we should not report it if we end
up falling back to the "assign in order of stmmac_probe_config_dt()".

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help