Re: [PATCH net-next v3 2/8] net: dsa: vsc73xx: convert to PHYLINK

From: Russell King (Oracle)
Date: Tue Sep 12 2023 - 12:49:47 EST


On Tue, Sep 12, 2023 at 02:21:56PM +0200, Pawel Dembicki wrote:
> +static void vsc73xx_phylink_mac_link_up(struct dsa_switch *ds, int port,
> + unsigned int mode,
> + phy_interface_t interface,
> + struct phy_device *phydev,
> + int speed, int duplex,
> + bool tx_pause, bool rx_pause)
> +{
> + struct vsc73xx *vsc = ds->priv;
> + u32 val;
> +
> + if (speed == SPEED_1000)
> + val = VSC73XX_MAC_CFG_GIGA_MODE | VSC73XX_MAC_CFG_TX_IPG_1000M;
> + else
> + val = VSC73XX_MAC_CFG_TX_IPG_100_10M;
> +
> + if (interface == PHY_INTERFACE_MODE_RGMII)
> + val |= VSC73XX_MAC_CFG_CLK_SEL_1000M;
> + else
> + val |= VSC73XX_MAC_CFG_CLK_SEL_EXT;

I know the original code tested against PHY_INTERFACE_MODE_RGMII, but
is this correct, or should it be:

if (phy_interface_is_rgmii(interface))

since the various RGMII* modes are used to determine the delay on the
PHY side.

Even so, I don't think that is a matter for this patch, but a future
(or maybe a preceeding patch) to address.

Other than that, I think it looks okay.

Thanks.

--
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!