Skip to content

Commit f22c993

Browse files
Wolfram SangPaolo Abeni
authored andcommitted
smsc911x: avoid PHY being resumed when interface is not up
SMSC911x doesn't need mdiobus suspend/resume, that's why it sets 'mac_managed_pm'. However, setting it needs to be moved from init to probe, so mdiobus PM functions will really never be called (e.g. when the interface is not up yet during suspend/resume). Fixes: 3ce9f2b ("net: smsc911x: Stop and start PHY during suspend and resume") Suggested-by: Heiner Kallweit <[email protected]> Signed-off-by: Wolfram Sang <[email protected]> Reviewed-by: Simon Horman <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Paolo Abeni <[email protected]>
1 parent b4c66d7 commit f22c993

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

drivers/net/ethernet/smsc/smsc911x.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1037,8 +1037,6 @@ static int smsc911x_mii_probe(struct net_device *dev)
10371037
return ret;
10381038
}
10391039

1040-
/* Indicate that the MAC is responsible for managing PHY PM */
1041-
phydev->mac_managed_pm = true;
10421040
phy_attached_info(phydev);
10431041

10441042
phy_set_max_speed(phydev, SPEED_100);
@@ -1066,6 +1064,7 @@ static int smsc911x_mii_init(struct platform_device *pdev,
10661064
struct net_device *dev)
10671065
{
10681066
struct smsc911x_data *pdata = netdev_priv(dev);
1067+
struct phy_device *phydev;
10691068
int err = -ENXIO;
10701069

10711070
pdata->mii_bus = mdiobus_alloc();
@@ -1108,6 +1107,10 @@ static int smsc911x_mii_init(struct platform_device *pdev,
11081107
goto err_out_free_bus_2;
11091108
}
11101109

1110+
phydev = phy_find_first(pdata->mii_bus);
1111+
if (phydev)
1112+
phydev->mac_managed_pm = true;
1113+
11111114
return 0;
11121115

11131116
err_out_free_bus_2:

0 commit comments

Comments
 (0)