]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commit
net: phy: Avoid multiple suspends
authorFlorian Fainelli <f.fainelli@gmail.com>
Thu, 20 Feb 2020 23:34:53 +0000 (15:34 -0800)
committerPaolo Pisati <paolo.pisati@canonical.com>
Wed, 18 Mar 2020 10:23:23 +0000 (11:23 +0100)
commit82476679f15a9b0df9a833e9617606096f4f92a3
tree5edbf0d3a0cbed04df96029bf0a925135586c493
parentc6daa03cdec005a2552164acc6e2904ac71fdded
net: phy: Avoid multiple suspends

BugLink: https://bugs.launchpad.net/bugs/1867903
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 <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
drivers/net/phy/phy_device.c