All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net] net: phy: Do not shutdown PHYs in READY state
@ 2021-10-08 21:42 Florian Fainelli
  2021-10-09 12:50 ` patchwork-bot+netdevbpf
  0 siblings, 1 reply; 2+ messages in thread
From: Florian Fainelli @ 2021-10-08 21:42 UTC (permalink / raw)
  To: netdev
  Cc: Florian Fainelli, Andrew Lunn, Heiner Kallweit, Russell King,
	David S. Miller, Jakub Kicinski, Ioana Ciornei, open list

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>
---
 drivers/net/phy/phy_device.c | 3 +++
 1 file changed, 3 insertions(+)

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);
 }
 
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH net] net: phy: Do not shutdown PHYs in READY state
  2021-10-08 21:42 [PATCH net] net: phy: Do not shutdown PHYs in READY state Florian Fainelli
@ 2021-10-09 12:50 ` patchwork-bot+netdevbpf
  0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+netdevbpf @ 2021-10-09 12:50 UTC (permalink / raw)
  To: Florian Fainelli
  Cc: netdev, andrew, hkallweit1, linux, davem, kuba, ioana.ciornei,
	linux-kernel

Hello:

This patch was applied to netdev/net.git (master)
by David S. Miller <davem@davemloft.net>:

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")
> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
> 
> [...]

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



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-10-09 12:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-08 21:42 [PATCH net] net: phy: Do not shutdown PHYs in READY state Florian Fainelli
2021-10-09 12:50 ` patchwork-bot+netdevbpf

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.