Skip to content

Commit e2badb4

Browse files
khayash1kuba-moo
authored andcommitted
net: ethernet: ave: Fix MAC to be in charge of PHY PM
The phylib callback is called after MAC driver's own resume callback is called. For AVE driver, after resuming immediately, PHY state machine is in PHY_NOLINK because there is a time lag from link-down to link-up due to autoneg. The result is WARN_ON() dump in mdio_bus_phy_resume(). Since ave_resume() itself calls phy_resume(), AVE driver should manage PHY PM. To indicate that MAC driver manages PHY PM, set phydev->mac_managed_pm to true to avoid the unnecessary phylib call and add missing phy_init_hw() to ave_resume(). Suggested-by: Heiner Kallweit <hkallweit1@gmail.com> Fixes: fba863b ("net: phy: make PHY PM ops a no-op if MAC driver manages PHY PM") Signed-off-by: Kunihiko Hayashi <hayashi.kunihiko@socionext.com> Link: https://lore.kernel.org/r/20221024072227.24769-1-hayashi.kunihiko@socionext.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent 0a8b43b commit e2badb4

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

drivers/net/ethernet/socionext/sni_ave.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1229,6 +1229,8 @@ static int ave_init(struct net_device *ndev)
12291229

12301230
phy_support_asym_pause(phydev);
12311231

1232+
phydev->mac_managed_pm = true;
1233+
12321234
phy_attached_info(phydev);
12331235

12341236
return 0;
@@ -1756,6 +1758,10 @@ static int ave_resume(struct device *dev)
17561758

17571759
ave_global_reset(ndev);
17581760

1761+
ret = phy_init_hw(ndev->phydev);
1762+
if (ret)
1763+
return ret;
1764+
17591765
ave_ethtool_get_wol(ndev, &wol);
17601766
wol.wolopts = priv->wolopts;
17611767
__ave_ethtool_set_wol(ndev, &wol);

0 commit comments

Comments
 (0)