diff options
authorRussell King <>2019-11-05 10:34:39 +0000
committerRussell King (Oracle) <>2021-07-02 16:35:25 +0100
commit69933d436c3265e477da52f08c9535972e2af788 (patch)
parente94465a1c19993e7aba474fbf2d8d41bf0f06e37 (diff)
net: phy: make phy_error() report which PHY has failed
phy_error() is called from phy_interrupt() or phy_state_machine(), and uses WARN_ON() to print a backtrace. The backtrace is not useful when reporting a PHY error. However, a system may contain multiple ethernet PHYs, and phy_error() gives no clue which one caused the problem. Replace WARN_ON() with a call to phydev_err() so that we can see which PHY had an error, and also inform the user that we are halting the PHY. Signed-off-by: Russell King <>
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c
index 2463976d417f..d88361f054a2 100644
--- a/drivers/net/phy/phy.c
+++ b/drivers/net/phy/phy.c
@@ -913,7 +913,7 @@ void phy_stop_machine(struct phy_device *phydev)
void phy_error(struct phy_device *phydev)
- WARN_ON(1);
+ phydev_err(phydev, "Error detected, halting PHY\n");
phydev->state = PHY_HALTED;