net: smsc911x: Stop and start PHY during suspend and resume
Commit744d23c71a
("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:fba863b816
("net: phy: make PHY PM ops a no-op if MAC driver manages PHY PM") Fixes:2aa70f8649
("net: smsc911x: Quieten netif during suspend") Signed-off-by: Florian Fainelli <f.fainelli@gmail.com> Link: https://lore.kernel.org/r/20220825023951.3220-1-f.fainelli@gmail.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
parent
2ca1c94ce0
commit
3ce9f2bef7
1 changed files with 6 additions and 0 deletions
|
@ -1037,6 +1037,8 @@ static int smsc911x_mii_probe(struct net_device *dev)
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Indicate that the MAC is responsible for managing PHY PM */
|
||||||
|
phydev->mac_managed_pm = true;
|
||||||
phy_attached_info(phydev);
|
phy_attached_info(phydev);
|
||||||
|
|
||||||
phy_set_max_speed(phydev, SPEED_100);
|
phy_set_max_speed(phydev, SPEED_100);
|
||||||
|
@ -2587,6 +2589,8 @@ static int smsc911x_suspend(struct device *dev)
|
||||||
if (netif_running(ndev)) {
|
if (netif_running(ndev)) {
|
||||||
netif_stop_queue(ndev);
|
netif_stop_queue(ndev);
|
||||||
netif_device_detach(ndev);
|
netif_device_detach(ndev);
|
||||||
|
if (!device_may_wakeup(dev))
|
||||||
|
phy_stop(ndev->phydev);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* enable wake on LAN, energy detection and the external PME
|
/* 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)) {
|
if (netif_running(ndev)) {
|
||||||
netif_device_attach(ndev);
|
netif_device_attach(ndev);
|
||||||
netif_start_queue(ndev);
|
netif_start_queue(ndev);
|
||||||
|
if (!device_may_wakeup(dev))
|
||||||
|
phy_start(ndev->phydev);
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Add table
Reference in a new issue