Skip to contentSkip to conversation

net: phy: Do not shutdown PHYs in READY state

PATCH Applied Florian Fainelli 2 participants 2 messages Oct 8, 2021 – Oct 9, 2021

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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")
---
 drivers/net/phy/phy_device.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/net/phy/phy_device.c +3 -0
index ba5ad86ec826..4f9990b47a37 100644
@@ -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);
 }
 
Signature · 1 line
2.25.1
#1 lore raw
This patch was applied to netdev/net.git (master) by David S. Miller <[email protected]>:

Hello:

This patch was applied to netdev/net.git (master)
by David S. Miller <[email protected]>:

Quoted 10 lines · On Fri, 8 Oct 2021 14:42:52 -0700 you wrote:

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")

[...]

Here is the summary with links:
- [net] net: phy: Do not shutdown PHYs in READY state

    https://git.kernel.org/netdev/net/c/f49823939e41

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html