diff options
author | Russell King <rmk+kernel@armlinux.org.uk> | 2019-11-05 10:34:39 +0000 |
---|---|---|
committer | Russell King (Oracle) <rmk+kernel@armlinux.org.uk> | 2024-04-16 16:51:08 +0100 |
commit | 93840becb709b4ac7f26e558995468d9a63c3eaa (patch) | |
tree | 237c68900d59df2865127f00ce24ba5c8a35a2fa /drivers | |
parent | adfbd07b515a9d82781e405183de6e4282bd623b (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>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/phy/phy.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c index 2f77ab180db1..ae1916861986 100644 --- a/drivers/net/phy/phy.c +++ b/drivers/net/phy/phy.c @@ -1260,6 +1260,8 @@ void phy_stop_machine(struct phy_device *phydev) static void phy_process_error(struct phy_device *phydev) { + phydev_err(phydev, "Error detected, halting PHY\n"); + /* phydev->lock must be held for the state change to be safe */ if (!mutex_is_locked(&phydev->lock)) phydev_err(phydev, "PHY-device data unsafe context\n"); @@ -1286,7 +1288,6 @@ static void phy_error_precise(struct phy_device *phydev, */ void phy_error(struct phy_device *phydev) { - WARN_ON(1); phy_process_error(phydev); } EXPORT_SYMBOL(phy_error); |