mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-07 19:30:30 +09:00
net: phy: Avoid multiple suspends
commit503ba7c696upstream. It is currently possible for a PHY device to be suspended as part of a network device driver's suspend call while it is still being attached to that net_device, either via phy_suspend() or implicitly via phy_stop(). Later on, when the MDIO bus controller get suspended, we would attempt to suspend again the PHY because it is still attached to a network device. This is both a waste of time and creates an opportunity for improper clock/power management bugs to creep in. Fixes:803dd9c77a("net: phy: avoid suspending twice a PHY") Signed-off-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
458c058c9c
commit
ba389f3620
@@ -91,7 +91,7 @@ static bool mdio_bus_phy_may_suspend(struct phy_device *phydev)
|
||||
* MDIO bus driver and clock gated at this point.
|
||||
*/
|
||||
if (!netdev)
|
||||
return !phydev->suspended;
|
||||
goto out;
|
||||
|
||||
if (netdev->wol_enabled)
|
||||
return false;
|
||||
@@ -111,7 +111,8 @@ static bool mdio_bus_phy_may_suspend(struct phy_device *phydev)
|
||||
if (device_may_wakeup(&netdev->dev))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
out:
|
||||
return !phydev->suspended;
|
||||
}
|
||||
|
||||
static int mdio_bus_phy_suspend(struct device *dev)
|
||||
|
||||
Reference in New Issue
Block a user