diff options
author | Lukas Wunner <lukas@wunner.de> | 2022-05-12 10:42:07 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2022-05-13 11:35:46 +0100 |
commit | 1e7b81edebc1466d4154c5e716eb87468f3eeee2 (patch) | |
tree | 71519b28b5b18538fe857eb9d9057b269b16bb19 /drivers/net/phy | |
parent | 7e8b617eb93f9fcaedac02cd19edcad31c767386 (diff) | |
download | linux-1e7b81edebc1466d4154c5e716eb87468f3eeee2.tar.gz linux-1e7b81edebc1466d4154c5e716eb87468f3eeee2.tar.bz2 linux-1e7b81edebc1466d4154c5e716eb87468f3eeee2.zip |
net: phy: smsc: Cope with hot-removal in interrupt handler
If reading the Interrupt Source Flag register fails with -ENODEV, then
the PHY has been hot-removed and the correct response is to bail out
instead of throwing a WARN splat and attempting to suspend the PHY.
The PHY should be stopped in due course anyway as the kernel
asynchronously tears down the device.
Tested-by: Oleksij Rempel <o.rempel@pengutronix.de> # LAN9514/9512/9500
Tested-by: Ferry Toth <fntoth@gmail.com> # LAN9514
Signed-off-by: Lukas Wunner <lukas@wunner.de>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/phy')
-rw-r--r-- | drivers/net/phy/smsc.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/net/phy/smsc.c b/drivers/net/phy/smsc.c index e0eadea4b4b5..1b54684b68a0 100644 --- a/drivers/net/phy/smsc.c +++ b/drivers/net/phy/smsc.c @@ -91,7 +91,9 @@ static irqreturn_t smsc_phy_handle_interrupt(struct phy_device *phydev) irq_status = phy_read(phydev, MII_LAN83C185_ISF); if (irq_status < 0) { - phy_error(phydev); + if (irq_status != -ENODEV) + phy_error(phydev); + return IRQ_NONE; } |