RE: [PATCH net 2/2] net: stmmac: skip only stmmac_ptp_register when resume from suspend

From: Ismail, Mohammad Athari
Date: Mon Jan 24 2022 - 18:24:21 EST




> -----Original Message-----
> From: Andrew Lunn <andrew@xxxxxxx>
> Sent: Monday, January 24, 2022 9:15 PM
> To: Ismail, Mohammad Athari <mohammad.athari.ismail@xxxxxxxxx>
> Cc: Giuseppe Cavallaro <peppe.cavallaro@xxxxxx>; Alexandre Torgue
> <alexandre.torgue@xxxxxx>; Jose Abreu <joabreu@xxxxxxxxxxxx>; David
> S . Miller <davem@xxxxxxxxxxxxx>; Jakub Kicinski <kuba@xxxxxxxxxx>;
> Maxime Coquelin <mcoquelin.stm32@xxxxxxxxx>; Ong, Boon Leong
> <boon.leong.ong@xxxxxxxxx>; Voon, Weifeng <weifeng.voon@xxxxxxxxx>;
> Wong, Vee Khee <vee.khee.wong@xxxxxxxxx>; Huacai Chen
> <chenhuacai@xxxxxxxxxx>; netdev@xxxxxxxxxxxxxxx; linux-stm32@st-md-
> mailman.stormreply.com; linux-arm-kernel@xxxxxxxxxxxxxxxxxxx; linux-
> kernel@xxxxxxxxxxxxxxx
> Subject: Re: [PATCH net 2/2] net: stmmac: skip only stmmac_ptp_register
> when resume from suspend
>
> > @@ -3308,13 +3309,11 @@ static int stmmac_hw_setup(struct net_device
> *dev, bool init_ptp)
> >
> > stmmac_mmc_setup(priv);
> >
> > - if (init_ptp) {
> > - ret = stmmac_init_ptp(priv);
> > - if (ret == -EOPNOTSUPP)
> > - netdev_warn(priv->dev, "PTP not supported by
> HW\n");
> > - else if (ret)
> > - netdev_warn(priv->dev, "PTP init failed\n");
> > - }
> > + ret = stmmac_init_ptp(priv, ptp_register);
> > + if (ret == -EOPNOTSUPP)
> > + netdev_warn(priv->dev, "PTP not supported by HW\n");
> > + else if (ret)
> > + netdev_warn(priv->dev, "PTP init failed\n");
>
> The init_ptp parameter now seems unused? If so, please remove it.

I believe you miss below diff. It is renamed to ptp_register.

-static int stmmac_hw_setup(struct net_device *dev, bool init_ptp)
+static int stmmac_hw_setup(struct net_device *dev, bool ptp_register)
{
struct stmmac_priv *priv = netdev_priv(dev);


There are build warnings as below. I'll fix it in v2.

../drivers/net/ethernet/stmicro/stmmac/stmmac_main.c:888: warning: Function parameter or member 'ptp_register' not described in 'stmmac_init_ptp'
../drivers/net/ethernet/stmicro/stmmac/stmmac_main.c:3256: warning: Excess function parameter 'init_ptp' description in 'stmmac_hw_setup

Thanks

-Athari-

>
> Andrew