Thread (27 messages) 27 messages, 4 authors, 2026-03-26

Re: [RFC PATCH 4/8] xilinx: tsn: Add Ethernet MAC (EMAC) and MDIO support to the TSN driver

From: Andrew Lunn <andrew@lunn.ch>
Date: 2026-02-20 15:13:07
Also in: linux-arm-kernel, linux-devicetree, lkml

+#define TSN_EMMC_LINKSPEED_10		0x0	   /* 10 Mbit */
If the MAC cannot do 10Mbps, why have this?
+static int emac_open(struct net_device *ndev)
+{
+	struct tsn_emac *emac = netdev_priv(ndev);
+	struct phy_device *phydev = NULL;
+
+	if (emac->phy_node) {
+		phydev = of_phy_connect(emac->ndev, emac->phy_node,
+					tsn_adjust_link_tsn,
+					emac->phy_flags,
+					emac->phy_mode);
+		if (!phydev)
+			dev_err(emac->common->dev, "of_phy_connect() failed\n");
+		else
+			phy_start(phydev);
+	}
Somewhere around here, i would expect you to tell phylib the MAC
cannot do 10Mbps. You don't want the PHY offering those speeds for
autoneg, otherwise it might actually negotiate 10Mbps.

I also think you should be using phylink, not phylib. But we first
need to finish the discussion about DSA vs pure switchdev. If this
ends up being a DSA driver, you will be using phylink anywhere. If it
is a pure switchdev driver, i would still recommend using phylink, you
are less likely to get things wrong, because the API is better
designed.

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