diff options
author | Florian Fainelli <f.fainelli@gmail.com> | 2021-10-09 00:42:52 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2021-10-09 15:47:37 +0300 |
commit | f49823939e41121fdffada4d583e3e38d28336f9 (patch) | |
tree | 47cd8823110a74ee2d3225ce30d56cbcf8d6f95e /drivers/net | |
parent | a5a14ea7b4e55604acb0dc9d88fdb4cb6945bc77 (diff) | |
download | linux-f49823939e41121fdffada4d583e3e38d28336f9.tar.xz |
net: phy: Do not shutdown PHYs in READY state
In case a PHY device was probed thus in the PHY_READY state, but not
configured and with no network device attached yet, we should not be
trying to shut it down because it has been brought back into reset by
phy_device_reset() towards the end of phy_probe() and anyway we have not
configured the PHY yet.
Fixes: e2f016cf7751 ("net: phy: add a shutdown procedure")
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/phy/phy_device.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c index ba5ad86ec826..4f9990b47a37 100644 --- a/drivers/net/phy/phy_device.c +++ b/drivers/net/phy/phy_device.c @@ -3125,6 +3125,9 @@ static void phy_shutdown(struct device *dev) { struct phy_device *phydev = to_phy_device(dev); + if (phydev->state == PHY_READY || !phydev->attached_dev) + return; + phy_disable_interrupts(phydev); } |