Some PHY (e.g. SMSC LAN87xx) clear their interrupt mask on software
reset. This breaks the ethernet interface on resuming from hibernation,
if the PHY is running in interrupt mode, so reconfigure interrupts
after the software reset in mdio_bus_phy_restore().
Signed-off-by: Laurent Badel <[email protected]>
---
drivers/net/phy/phy_device.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c
index 80c2e646c093..5070eed55447 100644
--- a/drivers/net/phy/phy_device.c
+++ b/drivers/net/phy/phy_device.c
@@ -324,6 +324,15 @@ static int mdio_bus_phy_restore(struct device *dev)
if (ret < 0)
return ret;
+ if (phydev->drv->config_intr && phy_interrupt_is_valid(phydev))
+ {
+ /* Some PHYs (e.g. SMSC LAN8720) clear their
+ * interrupt mask on software reset.
+ */
+ phy_free_interrupt(phydev);
+ phy_request_interrupt(phydev);
+ }
+
if (phydev->attached_dev && phydev->adjust_link)
phy_start_machine(phydev);
--
2.17.1
-----------------------------
Eaton Industries Manufacturing GmbH ~ Registered place of business: Route de la Longeraie 7, 1110, Morges, Switzerland
-----------------------------