Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

phy: Revert toggling reset changes.

This reverts:

ef1b5bf506b1 ("net: phy: Fix not to call phy_resume() if PHY is not attached")
8c85f4b81296 ("net: phy: micrel: add toggling phy reset if PHY is not attached")

Andrew Lunn informs me that there are alternative efforts
underway to fix this more properly.

Signed-off-by: David S. Miller <davem@davemloft.net>

+5 -14
-8
drivers/net/phy/micrel.c
··· 23 23 * ksz9477 24 24 */ 25 25 26 - #include <linux/delay.h> 27 26 #include <linux/kernel.h> 28 27 #include <linux/module.h> 29 28 #include <linux/phy.h> ··· 834 835 static int kszphy_resume(struct phy_device *phydev) 835 836 { 836 837 int ret; 837 - 838 - if (!phydev->attached_dev) { 839 - /* If the PHY is not attached, toggle the reset */ 840 - phy_device_reset(phydev, 1); 841 - udelay(1); 842 - phy_device_reset(phydev, 0); 843 - } 844 838 845 839 genphy_resume(phydev); 846 840
+5 -6
drivers/net/phy/phy_device.c
··· 220 220 static DEFINE_MUTEX(phy_fixup_lock); 221 221 222 222 #ifdef CONFIG_PM 223 - static bool mdio_bus_phy_may_suspend(struct phy_device *phydev, bool suspend) 223 + static bool mdio_bus_phy_may_suspend(struct phy_device *phydev) 224 224 { 225 225 struct device_driver *drv = phydev->mdio.dev.driver; 226 226 struct phy_driver *phydrv = to_phy_driver(drv); ··· 232 232 /* PHY not attached? May suspend if the PHY has not already been 233 233 * suspended as part of a prior call to phy_disconnect() -> 234 234 * phy_detach() -> phy_suspend() because the parent netdev might be the 235 - * MDIO bus driver and clock gated at this point. Also may resume if 236 - * PHY is not attached. 235 + * MDIO bus driver and clock gated at this point. 237 236 */ 238 237 if (!netdev) 239 - return suspend ? !phydev->suspended : phydev->suspended; 238 + return !phydev->suspended; 240 239 241 240 if (netdev->wol_enabled) 242 241 return false; ··· 270 271 if (phydev->attached_dev && phydev->adjust_link) 271 272 phy_stop_machine(phydev); 272 273 273 - if (!mdio_bus_phy_may_suspend(phydev, true)) 274 + if (!mdio_bus_phy_may_suspend(phydev)) 274 275 return 0; 275 276 276 277 return phy_suspend(phydev); ··· 281 282 struct phy_device *phydev = to_phy_device(dev); 282 283 int ret; 283 284 284 - if (!mdio_bus_phy_may_suspend(phydev, false)) 285 + if (!mdio_bus_phy_may_suspend(phydev)) 285 286 goto no_resume; 286 287 287 288 ret = phy_resume(phydev);