netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] net: phy: Invalidate LP advertising flags when restarting or disabling AN
@ 2015-01-27  0:58 Ben Hutchings
  2015-01-27  1:06 ` Florian Fainelli
  0 siblings, 1 reply; 2+ messages in thread
From: Ben Hutchings @ 2015-01-27  0:58 UTC (permalink / raw)
  To: Florian Fainelli; +Cc: netdev, linux-kernel

It is possible to see the old value of the LP advertising flags
through ethtool after reconfiguring the PHY and before autonegotiation
completes.  If autonegotiation is turned off then the last value seen
will persist indefinitely.

Signed-off-by: Ben Hutchings <ben.hutchings@codethink.co.uk>
---
 drivers/net/phy/phy.c |    3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c
index 767cd11..cdcac6a 100644
--- a/drivers/net/phy/phy.c
+++ b/drivers/net/phy/phy.c
@@ -439,6 +439,9 @@ int phy_start_aneg(struct phy_device *phydev)
 	if (AUTONEG_DISABLE == phydev->autoneg)
 		phy_sanitize_settings(phydev);
 
+	/* Invalidate LP advertising flags */
+	phydev->lp_advertising = 0;
+
 	err = phydev->drv->config_aneg(phydev);
 	if (err < 0)
 		goto out_unlock;
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH net-next] net: phy: Invalidate LP advertising flags when restarting or disabling AN
  2015-01-27  0:58 [PATCH net-next] net: phy: Invalidate LP advertising flags when restarting or disabling AN Ben Hutchings
@ 2015-01-27  1:06 ` Florian Fainelli
  0 siblings, 0 replies; 2+ messages in thread
From: Florian Fainelli @ 2015-01-27  1:06 UTC (permalink / raw)
  To: Ben Hutchings; +Cc: netdev, linux-kernel

On 26/01/15 16:58, Ben Hutchings wrote:
> It is possible to see the old value of the LP advertising flags
> through ethtool after reconfiguring the PHY and before autonegotiation
> completes.  If autonegotiation is turned off then the last value seen
> will persist indefinitely.

Good catch!

> 
> Signed-off-by: Ben Hutchings <ben.hutchings@codethink.co.uk>

Acked-by: Florian Fainelli <f.fainelli@gmail.com>

> ---
>  drivers/net/phy/phy.c |    3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c
> index 767cd11..cdcac6a 100644
> --- a/drivers/net/phy/phy.c
> +++ b/drivers/net/phy/phy.c
> @@ -439,6 +439,9 @@ int phy_start_aneg(struct phy_device *phydev)
>  	if (AUTONEG_DISABLE == phydev->autoneg)
>  		phy_sanitize_settings(phydev);
>  
> +	/* Invalidate LP advertising flags */
> +	phydev->lp_advertising = 0;
> +
>  	err = phydev->drv->config_aneg(phydev);
>  	if (err < 0)
>  		goto out_unlock;
> 


-- 
Florian

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-01-27  1:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-01-27  0:58 [PATCH net-next] net: phy: Invalidate LP advertising flags when restarting or disabling AN Ben Hutchings
2015-01-27  1:06 ` Florian Fainelli

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).