diff mbox series

[net-next,3/3] net: phy: marvell10g: set the PHY in low power by default

Message ID 20190228134837.32740-4-antoine.tenart@bootlin.com
State Changes Requested
Delegated to: David Miller
Headers show
Series net: phy: marvell10g: implement suspend/resume callbacks | expand

Commit Message

Antoine Tenart Feb. 28, 2019, 1:48 p.m. UTC
When the Marvell 10G PHYs are set out of reset, the LPOWER bit is set
depending on an hardware configuration choice. We also do not know what
is the PHY state at boot time. Hence, set the PHY in low power by
default when this driver probes.

Signed-off-by: Antoine Tenart <antoine.tenart@bootlin.com>
---
 drivers/net/phy/marvell10g.c | 13 ++-----------
 1 file changed, 2 insertions(+), 11 deletions(-)

Comments

Andrew Lunn Feb. 28, 2019, 2:22 p.m. UTC | #1
> Signed-off-by: Antoine Tenart <antoine.tenart@bootlin.com>
> ---
>  drivers/net/phy/marvell10g.c | 13 ++-----------
>  1 file changed, 2 insertions(+), 11 deletions(-)
> 
> diff --git a/drivers/net/phy/marvell10g.c b/drivers/net/phy/marvell10g.c
> index e5d098bd33a6..765edd34a7dd 100644
> --- a/drivers/net/phy/marvell10g.c
> +++ b/drivers/net/phy/marvell10g.c
> @@ -245,17 +245,8 @@ static int mv3310_probe(struct phy_device *phydev)
>  	if (ret)
>  		return ret;
>  
> -	return 0;
> -}
> -
> -static int mv3310_suspend(struct phy_device *phydev)
> -{
> -	return 0;
> -}
> -
> -static int mv3310_resume(struct phy_device *phydev)
> -{
> -	return mv3310_hwmon_config(phydev, true);

Hi Antoine

I'm confused.

Didn't patch 1 just add suspend and resume callback? And here you are
removing some other suspend and resume callbacks? Did we have two sets
for a short while?

    Andrew
Antoine Tenart Feb. 28, 2019, 2:44 p.m. UTC | #2
Hi Andrew,

On Thu, Feb 28, 2019 at 03:22:43PM +0100, Andrew Lunn wrote:
> > Signed-off-by: Antoine Tenart <antoine.tenart@bootlin.com>
> > ---
> >  drivers/net/phy/marvell10g.c | 13 ++-----------
> >  1 file changed, 2 insertions(+), 11 deletions(-)
> > 
> > diff --git a/drivers/net/phy/marvell10g.c b/drivers/net/phy/marvell10g.c
> > index e5d098bd33a6..765edd34a7dd 100644
> > --- a/drivers/net/phy/marvell10g.c
> > +++ b/drivers/net/phy/marvell10g.c
> > @@ -245,17 +245,8 @@ static int mv3310_probe(struct phy_device *phydev)
> >  	if (ret)
> >  		return ret;
> >  
> > -	return 0;
> > -}
> > -
> > -static int mv3310_suspend(struct phy_device *phydev)
> > -{
> > -	return 0;
> > -}
> > -
> > -static int mv3310_resume(struct phy_device *phydev)
> > -{
> > -	return mv3310_hwmon_config(phydev, true);
> 
> 
> I'm confused.
> 
> Didn't patch 1 just add suspend and resume callback? And here you are
> removing some other suspend and resume callbacks? Did we have two sets
> for a short while?

Indeed. I just check and what happened is I initially had the
suspend/resume callbacks implementation and this patch into the same
patch. And then I made a mistake when splitting them, leaving two
suspend/resume functions, and I did not see that when reviewing the
series...

Sorry about that, I'll fix it!

Thanks,
Antoine
diff mbox series

Patch

diff --git a/drivers/net/phy/marvell10g.c b/drivers/net/phy/marvell10g.c
index e5d098bd33a6..765edd34a7dd 100644
--- a/drivers/net/phy/marvell10g.c
+++ b/drivers/net/phy/marvell10g.c
@@ -245,17 +245,8 @@  static int mv3310_probe(struct phy_device *phydev)
 	if (ret)
 		return ret;
 
-	return 0;
-}
-
-static int mv3310_suspend(struct phy_device *phydev)
-{
-	return 0;
-}
-
-static int mv3310_resume(struct phy_device *phydev)
-{
-	return mv3310_hwmon_config(phydev, true);
+	/* Set the PHY in low power mode by default */
+	return mv3310_suspend(phydev);
 }
 
 /* Some PHYs in the Alaska family such as the 88X3310 and the 88E2010