Subject: Re: [PATCH net-next v2 31/35] [RFT] net: dpaa: Convert to phylink

From: "Russell King (Oracle)" <[email-masked]>
Date: Wed, 29 Jun 2022 15:44:27 +0100

On Tue, Jun 28, 2022 at 06:14:00PM -0400, Sean Anderson wrote:
> +static void dtsec_mac_config(struct phylink_config *config, unsigned int mode,
> +			     const struct phylink_link_state *state)
> +{
> +	struct mac_device *mac_dev = fman_config_to_mac(config);
> +	struct dtsec_regs __iomem *regs = mac_dev->fman_mac->regs;
> +	u32 tmp;
> +
> +	switch (state->interface) {
> +	case PHY_INTERFACE_MODE_RMII:
> +		tmp = DTSEC_ECNTRL_RMM;
> +		break;
> +	case PHY_INTERFACE_MODE_RGMII:
> +	case PHY_INTERFACE_MODE_RGMII_ID:
> +	case PHY_INTERFACE_MODE_RGMII_RXID:
> +	case PHY_INTERFACE_MODE_RGMII_TXID:
> +		tmp = DTSEC_ECNTRL_GMIIM | DTSEC_ECNTRL_RPM;
> +		break;
> +	case PHY_INTERFACE_MODE_SGMII:
> +	case PHY_INTERFACE_MODE_1000BASEX:
> +	case PHY_INTERFACE_MODE_2500BASEX:
> +		tmp = DTSEC_ECNTRL_TBIM | DTSEC_ECNTRL_SGMIIM;
> +		break;
> +	default:
> +		dev_warn(mac_dev->dev, "cannot configure dTSEC for %s\n",
> +			 phy_modes(state->interface));
> +	}
> +
> +	if (state->speed == SPEED_100)
> +		tmp |= DTSEC_ECNTRL_R100M;

Please do not refer to state->speed here, it is meaningless. What are
you trying to achieve here?

It looks like the old dtsec_adjust_link() used to set/clear this when
the link comes up - so can it be moved to dtsec_link_up() ?

Thanks.

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