netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net] net: smsc911x: Stop and start PHY during suspend and resume
@ 2022-08-25  2:39 Florian Fainelli
  2022-08-27  2:00 ` patchwork-bot+netdevbpf
  0 siblings, 1 reply; 2+ messages in thread
From: Florian Fainelli @ 2022-08-25  2:39 UTC (permalink / raw)
  To: netdev
  Cc: Florian Fainelli, Geert Uytterhoeven, Marek Szyprowski,
	Steve Glendinning, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Heiner Kallweit, open list

Commit 744d23c71af3 ("net: phy: Warn about incorrect
mdio_bus_phy_resume() state") unveiled that the smsc911x driver was not
properly stopping and restarting the PHY during suspend/resume. Correct
that by indicating that the MAC is in charge of PHY PM operations and
ensure that all MDIO bus activity is quiescent during suspend.

Tested-by: Geert Uytterhoeven <geert+renesas@glider.be>
Tested-by: Marek Szyprowski <m.szyprowski@samsung.com>
Fixes: fba863b81604 ("net: phy: make PHY PM ops a no-op if MAC driver manages PHY PM")
Fixes: 2aa70f864955 ("net: smsc911x: Quieten netif during suspend")
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
 drivers/net/ethernet/smsc/smsc911x.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/net/ethernet/smsc/smsc911x.c b/drivers/net/ethernet/smsc/smsc911x.c
index 3bf20211cceb..3829c2805b16 100644
--- a/drivers/net/ethernet/smsc/smsc911x.c
+++ b/drivers/net/ethernet/smsc/smsc911x.c
@@ -1037,6 +1037,8 @@ static int smsc911x_mii_probe(struct net_device *dev)
 		return ret;
 	}
 
+	/* Indicate that the MAC is responsible for managing PHY PM */
+	phydev->mac_managed_pm = true;
 	phy_attached_info(phydev);
 
 	phy_set_max_speed(phydev, SPEED_100);
@@ -2587,6 +2589,8 @@ static int smsc911x_suspend(struct device *dev)
 	if (netif_running(ndev)) {
 		netif_stop_queue(ndev);
 		netif_device_detach(ndev);
+		if (!device_may_wakeup(dev))
+			phy_stop(ndev->phydev);
 	}
 
 	/* enable wake on LAN, energy detection and the external PME
@@ -2628,6 +2632,8 @@ static int smsc911x_resume(struct device *dev)
 	if (netif_running(ndev)) {
 		netif_device_attach(ndev);
 		netif_start_queue(ndev);
+		if (!device_may_wakeup(dev))
+			phy_start(ndev->phydev);
 	}
 
 	return 0;
-- 
2.25.1


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

* Re: [PATCH net] net: smsc911x: Stop and start PHY during suspend and resume
  2022-08-25  2:39 [PATCH net] net: smsc911x: Stop and start PHY during suspend and resume Florian Fainelli
@ 2022-08-27  2:00 ` patchwork-bot+netdevbpf
  0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+netdevbpf @ 2022-08-27  2:00 UTC (permalink / raw)
  To: Florian Fainelli
  Cc: netdev, geert+renesas, m.szyprowski, steve.glendinning, davem,
	edumazet, kuba, pabeni, hkallweit1, linux-kernel

Hello:

This patch was applied to netdev/net.git (master)
by Jakub Kicinski <kuba@kernel.org>:

On Wed, 24 Aug 2022 19:39:51 -0700 you wrote:
> Commit 744d23c71af3 ("net: phy: Warn about incorrect
> mdio_bus_phy_resume() state") unveiled that the smsc911x driver was not
> properly stopping and restarting the PHY during suspend/resume. Correct
> that by indicating that the MAC is in charge of PHY PM operations and
> ensure that all MDIO bus activity is quiescent during suspend.
> 
> Tested-by: Geert Uytterhoeven <geert+renesas@glider.be>
> Tested-by: Marek Szyprowski <m.szyprowski@samsung.com>
> Fixes: fba863b81604 ("net: phy: make PHY PM ops a no-op if MAC driver manages PHY PM")
> Fixes: 2aa70f864955 ("net: smsc911x: Quieten netif during suspend")
> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
> 
> [...]

Here is the summary with links:
  - [net] net: smsc911x: Stop and start PHY during suspend and resume
    https://git.kernel.org/netdev/net/c/3ce9f2bef755

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:[~2022-08-27  2:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-25  2:39 [PATCH net] net: smsc911x: Stop and start PHY during suspend and resume Florian Fainelli
2022-08-27  2:00 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).