summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@armlinux.org.uk>2019-11-05 10:34:39 +0000
committerRussell King <rmk+kernel@armlinux.org.uk>2020-06-29 01:19:14 +0100
commit981455fd371017a06ff57ef7b7716faf6d88a823 (patch)
tree07474941a4311846d76b089c537934b472bce847
parentc6ead6f327129b6c5b5a59931d87f154de681b9e (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 <rmk+kernel@armlinux.org.uk>
-rw-r--r--drivers/net/phy/phy.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c
index c185503af5f7..378d8210a968 100644
--- a/drivers/net/phy/phy.c
+++ b/drivers/net/phy/phy.c
@@ -681,7 +681,7 @@ void phy_stop_machine(struct phy_device *phydev)
*/
static void phy_error(struct phy_device *phydev)
{
- WARN_ON(1);
+ phydev_err(phydev, "Error detected, halting PHY\n");
mutex_lock(&phydev->lock);
phydev->state = PHY_HALTED;