All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net] net: phy: marvell: don't interpret PHY status unless resolved
@ 2020-02-27  9:44 Russell King
  2020-02-27 17:23 ` Florian Fainelli
  2020-02-27 19:19 ` David Miller
  0 siblings, 2 replies; 3+ messages in thread
From: Russell King @ 2020-02-27  9:44 UTC (permalink / raw)
  To: Andrew Lunn, Florian Fainelli, Heiner Kallweit; +Cc: David S. Miller, netdev

Don't attempt to interpret the PHY specific status register unless
the PHY is indicating that the resolution is valid.

Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
---
 drivers/net/phy/marvell.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/net/phy/marvell.c b/drivers/net/phy/marvell.c
index 28e33ece4ce1..9a8badafea8a 100644
--- a/drivers/net/phy/marvell.c
+++ b/drivers/net/phy/marvell.c
@@ -1306,6 +1306,9 @@ static int marvell_read_status_page_an(struct phy_device *phydev,
 		}
 	}
 
+	if (!(status & MII_M1011_PHY_STATUS_RESOLVED))
+		return 0;
+
 	if (status & MII_M1011_PHY_STATUS_FULLDUPLEX)
 		phydev->duplex = DUPLEX_FULL;
 	else
@@ -1365,6 +1368,8 @@ static int marvell_read_status_page(struct phy_device *phydev, int page)
 	linkmode_zero(phydev->lp_advertising);
 	phydev->pause = 0;
 	phydev->asym_pause = 0;
+	phydev->speed = SPEED_UNKNOWN;
+	phydev->duplex = DUPLEX_UNKNOWN;
 
 	if (phydev->autoneg == AUTONEG_ENABLE)
 		err = marvell_read_status_page_an(phydev, fiber, status);
-- 
2.20.1


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

* Re: [PATCH net] net: phy: marvell: don't interpret PHY status unless resolved
  2020-02-27  9:44 [PATCH net] net: phy: marvell: don't interpret PHY status unless resolved Russell King
@ 2020-02-27 17:23 ` Florian Fainelli
  2020-02-27 19:19 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: Florian Fainelli @ 2020-02-27 17:23 UTC (permalink / raw)
  To: Russell King, Andrew Lunn, Heiner Kallweit; +Cc: David S. Miller, netdev

On 2/27/20 1:44 AM, Russell King wrote:
> Don't attempt to interpret the PHY specific status register unless
> the PHY is indicating that the resolution is valid.
> 
> Reviewed-by: Andrew Lunn <andrew@lunn.ch>
> Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>

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

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

* Re: [PATCH net] net: phy: marvell: don't interpret PHY status unless resolved
  2020-02-27  9:44 [PATCH net] net: phy: marvell: don't interpret PHY status unless resolved Russell King
  2020-02-27 17:23 ` Florian Fainelli
@ 2020-02-27 19:19 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2020-02-27 19:19 UTC (permalink / raw)
  To: rmk+kernel; +Cc: andrew, f.fainelli, hkallweit1, netdev

From: Russell King <rmk+kernel@armlinux.org.uk>
Date: Thu, 27 Feb 2020 09:44:49 +0000

> Don't attempt to interpret the PHY specific status register unless
> the PHY is indicating that the resolution is valid.
> 
> Reviewed-by: Andrew Lunn <andrew@lunn.ch>
> Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>

Applied.

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

end of thread, other threads:[~2020-02-27 19:19 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-27  9:44 [PATCH net] net: phy: marvell: don't interpret PHY status unless resolved Russell King
2020-02-27 17:23 ` Florian Fainelli
2020-02-27 19:19 ` David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.