Skip to content

Commit 7b566f7

Browse files
committed
phy: Revert toggling reset changes.
This reverts: ef1b5bf ("net: phy: Fix not to call phy_resume() if PHY is not attached") 8c85f4b ("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 <[email protected]>
1 parent a2c741d commit 7b566f7

File tree

2 files changed

+5
-14
lines changed

2 files changed

+5
-14
lines changed

drivers/net/phy/micrel.c

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
* ksz9477
2424
*/
2525

26-
#include <linux/delay.h>
2726
#include <linux/kernel.h>
2827
#include <linux/module.h>
2928
#include <linux/phy.h>
@@ -836,13 +835,6 @@ static int kszphy_resume(struct phy_device *phydev)
836835
{
837836
int ret;
838837

839-
if (!phydev->attached_dev) {
840-
/* If the PHY is not attached, toggle the reset */
841-
phy_device_reset(phydev, 1);
842-
udelay(1);
843-
phy_device_reset(phydev, 0);
844-
}
845-
846838
genphy_resume(phydev);
847839

848840
ret = kszphy_config_reset(phydev);

drivers/net/phy/phy_device.c

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ static LIST_HEAD(phy_fixup_list);
220220
static DEFINE_MUTEX(phy_fixup_lock);
221221

222222
#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)
224224
{
225225
struct device_driver *drv = phydev->mdio.dev.driver;
226226
struct phy_driver *phydrv = to_phy_driver(drv);
@@ -232,11 +232,10 @@ static bool mdio_bus_phy_may_suspend(struct phy_device *phydev, bool suspend)
232232
/* PHY not attached? May suspend if the PHY has not already been
233233
* suspended as part of a prior call to phy_disconnect() ->
234234
* 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.
237236
*/
238237
if (!netdev)
239-
return suspend ? !phydev->suspended : phydev->suspended;
238+
return !phydev->suspended;
240239

241240
if (netdev->wol_enabled)
242241
return false;
@@ -271,7 +270,7 @@ static int mdio_bus_phy_suspend(struct device *dev)
271270
if (phydev->attached_dev && phydev->adjust_link)
272271
phy_stop_machine(phydev);
273272

274-
if (!mdio_bus_phy_may_suspend(phydev, true))
273+
if (!mdio_bus_phy_may_suspend(phydev))
275274
return 0;
276275

277276
return phy_suspend(phydev);
@@ -282,7 +281,7 @@ static int mdio_bus_phy_resume(struct device *dev)
282281
struct phy_device *phydev = to_phy_device(dev);
283282
int ret;
284283

285-
if (!mdio_bus_phy_may_suspend(phydev, false))
284+
if (!mdio_bus_phy_may_suspend(phydev))
286285
goto no_resume;
287286

288287
ret = phy_resume(phydev);

0 commit comments

Comments
 (0)