[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20221201175302.2732938-1-l.stach@pengutronix.de>
Date: Thu, 1 Dec 2022 18:53:02 +0100
From: Lucas Stach <l.stach@...gutronix.de>
To: Russell King <linux@...linux.org.uk>, Andrew Lunn <andrew@...n.ch>,
Heiner Kallweit <hkallweit1@...il.com>
Cc: netdev@...r.kernel.org, kernel@...gutronix.de,
patchwork-lst@...gutronix.de
Subject: [PATCH] net: phylink: don't try to stop halted PHY
When the PHY driver has encountered a non-recoverable error condition, e.g
due to a failure in MDIO communication it may have already halted the PHY
by calling phy_error(). If that is the case then phylink should not try to
stop the PHY again.
Signed-off-by: Lucas Stach <l.stach@...gutronix.de>
---
drivers/net/phy/phylink.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/phy/phylink.c b/drivers/net/phy/phylink.c
index 6547b6cc6cbe..1e2be9197567 100644
--- a/drivers/net/phy/phylink.c
+++ b/drivers/net/phy/phylink.c
@@ -1935,7 +1935,7 @@ void phylink_stop(struct phylink *pl)
if (pl->sfp_bus)
sfp_upstream_stop(pl->sfp_bus);
- if (pl->phydev)
+ if (pl->phydev && phy_is_started(pl->phydev))
phy_stop(pl->phydev);
del_timer_sync(&pl->link_poll);
if (pl->link_irq) {
--
2.30.2
Powered by blists - more mailing lists