RE: [PATCH net-next v3 2/3] net: pcs: add 2500BASEX support for Intel mGbE controller

From: Sit, Michael Wei Hong
Date: Thu May 27 2021 - 21:58:09 EST




> -----Original Message-----
> From: Andrew Lunn <andrew@xxxxxxx>
> Sent: Friday, 28 May, 2021 7:27 AM
> To: Sit, Michael Wei Hong <michael.wei.hong.sit@xxxxxxxxx>
> Cc: Jose.Abreu@xxxxxxxxxxxx; hkallweit1@xxxxxxxxx;
> linux@xxxxxxxxxxxxxxx; kuba@xxxxxxxxxx;
> netdev@xxxxxxxxxxxxxxx; peppe.cavallaro@xxxxxx;
> alexandre.torgue@xxxxxxxxxxx; davem@xxxxxxxxxxxxx;
> mcoquelin.stm32@xxxxxxxxx; Voon, Weifeng
> <weifeng.voon@xxxxxxxxx>; Ong, Boon Leong
> <boon.leong.ong@xxxxxxxxx>; Tan, Tee Min
> <tee.min.tan@xxxxxxxxx>; vee.khee.wong@xxxxxxxxxxxxxxx;
> Wong, Vee Khee <vee.khee.wong@xxxxxxxxx>; linux-stm32@st-
> md-mailman.stormreply.com; linux-arm-
> kernel@xxxxxxxxxxxxxxxxxxx; linux-kernel@xxxxxxxxxxxxxxx
> Subject: Re: [PATCH net-next v3 2/3] net: pcs: add 2500BASEX
> support for Intel mGbE controller
>
> > +static int xpcs_config_2500basex(struct mdio_xpcs_args *xpcs)
> {
> > + int ret;
> > +
> > + ret = xpcs_read(xpcs, MDIO_MMD_VEND2,
> DW_VR_MII_DIG_CTRL1);
> > + if (ret < 0)
> > + return ret;
> > + ret |= DW_VR_MII_DIG_CTRL1_2G5_EN;
> > + ret &=
> ~DW_VR_MII_DIG_CTRL1_MAC_AUTO_SW;
> > + ret = xpcs_write(xpcs, MDIO_MMD_VEND2,
> DW_VR_MII_DIG_CTRL1, ret);
> > + if (ret < 0)
> > + return ret;
> > +
> > + ret = xpcs_read(xpcs, MDIO_MMD_VEND2,
> DW_VR_MII_MMD_CTRL);
> > + if (ret < 0)
> > + return ret;
> > + ret &= ~AN_CL37_EN;
> > + ret |= SGMII_SPEED_SS6;
> > + ret &= ~SGMII_SPEED_SS13;
> > + return xpcs_write(xpcs, MDIO_MMD_VEND2,
> DW_VR_MII_MMD_CTRL, ret);
> > +
> > + return 0;
>
> Indentation is messed up here? Or a rebase gone wrong
> removing an if statement?
>
Thanks Andrew! Good catch, missed this indentation error,
will fix in next revision
> Andrew