[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <95ff93fffa161a7a96604b4dfe2be933fe740785.1651574194.git.lukas@wunner.de>
Date: Tue, 3 May 2022 15:15:07 +0200
From: Lukas Wunner <lukas@...ner.de>
To: "David S. Miller" <davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>
Cc: netdev@...r.kernel.org, linux-usb@...r.kernel.org,
Steve Glendinning <steve.glendinning@...well.net>,
UNGLinuxDriver@...rochip.com, Oliver Neukum <oneukum@...e.com>,
Andre Edich <andre.edich@...rochip.com>,
Oleksij Rempel <linux@...pel-privat.de>,
Martyn Welch <martyn.welch@...labora.com>,
Gabriel Hojda <ghojda@...urs.ro>,
Christoph Fritz <chf.fritz@...glemail.com>,
Lino Sanfilippo <LinoSanfilippo@....de>,
Philipp Rosenberger <p.rosenberger@...bus.com>,
Heiner Kallweit <hkallweit1@...il.com>,
Andrew Lunn <andrew@...n.ch>,
Russell King <linux@...linux.org.uk>,
Ferry Toth <fntoth@...il.com>
Subject: [PATCH net-next v2 7/7] 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@...gutronix.de> # LAN9514/9512/9500
Tested-by: Ferry Toth <fntoth@...il.com> # LAN9514
Signed-off-by: Lukas Wunner <lukas@...ner.de>
---
drivers/net/phy/smsc.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/net/phy/smsc.c b/drivers/net/phy/smsc.c
index a521d48b22a7..35bff7fd234c 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;
}
--
2.35.2
Powered by blists - more mailing lists