Patch "net: smsc911x: Stop and start PHY during suspend and resume" has been added to the 5.15-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    net: smsc911x: Stop and start PHY during suspend and resume

to the 5.15-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     net-smsc911x-stop-and-start-phy-during-suspend-and-r.patch
and it can be found in the queue-5.15 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 0f61d12fddc9b60884591c74f9f7700205a3b18b
Author: Florian Fainelli <f.fainelli@xxxxxxxxx>
Date:   Wed Aug 24 19:39:51 2022 -0700

    net: smsc911x: Stop and start PHY during suspend and resume
    
    [ Upstream commit 3ce9f2bef75528936c78a7053301f5725f622f3a ]
    
    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@xxxxxxxxx>
    Tested-by: Marek Szyprowski <m.szyprowski@xxxxxxxxxxx>
    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@xxxxxxxxx>
    Link: https://lore.kernel.org/r/20220825023951.3220-1-f.fainelli@xxxxxxxxx
    Signed-off-by: Jakub Kicinski <kuba@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/net/ethernet/smsc/smsc911x.c b/drivers/net/ethernet/smsc/smsc911x.c
index 592e191adbf7d..63b99dd8ca51c 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);
@@ -2584,6 +2586,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
@@ -2625,6 +2629,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;



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux