RE: [RFC PATCH 4/8] xilinx: tsn: Add Ethernet MAC (EMAC) and MDIO support to the TSN driver
From: Neeli, Srinivas
Date: Tue Feb 24 2026 - 06:18:04 EST
[Public]
Hi,
> -----Original Message-----
> From: Andrew Lunn <andrew@xxxxxxx>
> Sent: Friday, February 20, 2026 8:43 PM
> To: Neeli, Srinivas <srinivas.neeli@xxxxxxx>
> Cc: andrew+netdev@xxxxxxx; davem@xxxxxxxxxxxxx;
> edumazet@xxxxxxxxxx; kuba@xxxxxxxxxx; pabeni@xxxxxxxxxx; Simek,
> Michal <michal.simek@xxxxxxx>; robh@xxxxxxxxxx; krzk+dt@xxxxxxxxxx;
> conor+dt@xxxxxxxxxx; richardcochran@xxxxxxxxx; netdev@xxxxxxxxxxxxxxx;
> linux-kernel@xxxxxxxxxxxxxxx; devicetree@xxxxxxxxxxxxxxx; linux-arm-
> kernel@xxxxxxxxxxxxxxxxxxx; git (AMD-Xilinx) <git@xxxxxxx>
> Subject: Re: [RFC PATCH 4/8] xilinx: tsn: Add Ethernet MAC (EMAC) and MDIO
> support to the TSN driver
>
> > +#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
Thank you for the detailed feedback.
I agree with your comments. I plan to rework this driver to use the phylink framework instead of phylib, as it is a better fit and avoids getting these details wrong.
In the next revision, I will also address the 10 Mbps handling and ensure that unsupported link modes are properly constrained, so they are not advertised or negotiated.
Thanks for the guidance.
Thanks
Neeli Srinivas