From: Greg Kroah-Hartman Date: Sun, 15 Mar 2020 11:59:37 +0000 (+0100) Subject: 5.5-stable patches X-Git-Tag: v4.19.110~7 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e67b8690a55a55b4580a452fcdd21dd7c6ae53f5;p=thirdparty%2Fkernel%2Fstable-queue.git 5.5-stable patches added patches: net-phy-avoid-multiple-suspends.patch --- diff --git a/queue-5.5/net-phy-avoid-multiple-suspends.patch b/queue-5.5/net-phy-avoid-multiple-suspends.patch new file mode 100644 index 00000000000..37308271215 --- /dev/null +++ b/queue-5.5/net-phy-avoid-multiple-suspends.patch @@ -0,0 +1,50 @@ +From 503ba7c6961034ff0047707685644cad9287c226 Mon Sep 17 00:00:00 2001 +From: Florian Fainelli +Date: Thu, 20 Feb 2020 15:34:53 -0800 +Subject: net: phy: Avoid multiple suspends + +From: Florian Fainelli + +commit 503ba7c6961034ff0047707685644cad9287c226 upstream. + +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: 803dd9c77ac3 ("net: phy: avoid suspending twice a PHY") +Signed-off-by: Florian Fainelli +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/net/phy/phy_device.c | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +--- a/drivers/net/phy/phy_device.c ++++ b/drivers/net/phy/phy_device.c +@@ -247,7 +247,7 @@ static bool mdio_bus_phy_may_suspend(str + * MDIO bus driver and clock gated at this point. + */ + if (!netdev) +- return !phydev->suspended; ++ goto out; + + if (netdev->wol_enabled) + return false; +@@ -267,7 +267,8 @@ static bool mdio_bus_phy_may_suspend(str + if (device_may_wakeup(&netdev->dev)) + return false; + +- return true; ++out: ++ return !phydev->suspended; + } + + static int mdio_bus_phy_suspend(struct device *dev) diff --git a/queue-5.5/series b/queue-5.5/series index 1a92218a4ce..66ed72222aa 100644 --- a/queue-5.5/series +++ b/queue-5.5/series @@ -68,3 +68,4 @@ s390-qeth-don-t-reset-default_out_queue.patch s390-qeth-handle-error-when-backing-rx-buffer.patch net-dsa-don-t-instantiate-phylink-for-cpu-dsa-ports-unless-needed.patch net-dsa-mv88e6xxx-add-missing-mask-of-atu-occupancy-register.patch +net-phy-avoid-multiple-suspends.patch