[RESEND PATCH net-next v4 1/3] net: stmmac: split xPCS setup from mdio register

Voon, Weifeng weifeng.voon at intel.com
Thu Jun 3 23:53:42 PDT 2021


> @@ -7002,6 +7006,9 @@ int stmmac_dvr_probe(struct device *device,
>  		}
>  	}
> 
> +	if (priv->plat->speed_mode_2500)
> +		pri*v->plat->speed_mode_2500(ndev, priv->plat->bsp_priv);
> +
>  	if (priv->plat->mdio_bus_data->has_xpcs) {
>  		ret = stmmac_xpcs_setup(priv->mii);
>  		if (ret)
> 
> With the current placement, there seems to be indeed no way for the
> platform-level code to set plat->phy_interface after the MDIO bus has
> probed but before the XPCS has probed.
> 
> I wonder whether it might be possible to probe the XPCS completely
> outside of stmmac_dvr_probe(); once that function ends you should have
> all knowledge necessary to set plat->phy_interface all within the
> Intel platform code. An additional benefit if you do this is that you
> no longer need the has_xpcs variable - Intel is the only one setting
> it right now, as far as I can see. What do you think?

Hi Vladimir, I still think that stmmac_dvr_probe() the suitable place to
probe the XPCS together with MDIO and PHY setup. In addition, XPCS also
need to be probed before stmmac_open()as there is an checking of XPCS AN
mode at the very beginning of the function. 

The has_xpcs variable is introduced in the very first commits in the XPCS design.
Although currently Intel is the only one using it, it is beneficial for any
future system that pair stmmac with xpcs.  

Weifeng




More information about the linux-arm-kernel mailing list