Skip to content

Commit 7f5ebf5

Browse files
Wolfram Sangkuba-moo
authored andcommitted
ravb: avoid PHY being resumed when interface is not up
RAVB 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: 4924c0c ("net: ravb: Fix PHY state warning splat during system resume") Suggested-by: Heiner Kallweit <[email protected]> Signed-off-by: Wolfram Sang <[email protected]> Reviewed-by: Michal Kubiak <[email protected]> Reviewed-by: Sergey Shtylyov <[email protected]> Reviewed-by: Florian Fainelli <[email protected]> Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 0450479 commit 7f5ebf5

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

drivers/net/ethernet/renesas/ravb_main.c

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1455,8 +1455,6 @@ static int ravb_phy_init(struct net_device *ndev)
14551455
phy_remove_link_mode(phydev, ETHTOOL_LINK_MODE_100baseT_Half_BIT);
14561456
}
14571457

1458-
/* Indicate that the MAC is responsible for managing PHY PM */
1459-
phydev->mac_managed_pm = true;
14601458
phy_attached_info(phydev);
14611459

14621460
return 0;
@@ -2379,6 +2377,8 @@ static int ravb_mdio_init(struct ravb_private *priv)
23792377
{
23802378
struct platform_device *pdev = priv->pdev;
23812379
struct device *dev = &pdev->dev;
2380+
struct phy_device *phydev;
2381+
struct device_node *pn;
23822382
int error;
23832383

23842384
/* Bitbang init */
@@ -2400,6 +2400,14 @@ static int ravb_mdio_init(struct ravb_private *priv)
24002400
if (error)
24012401
goto out_free_bus;
24022402

2403+
pn = of_parse_phandle(dev->of_node, "phy-handle", 0);
2404+
phydev = of_phy_find_device(pn);
2405+
if (phydev) {
2406+
phydev->mac_managed_pm = true;
2407+
put_device(&phydev->mdio.dev);
2408+
}
2409+
of_node_put(pn);
2410+
24032411
return 0;
24042412

24052413
out_free_bus:

0 commit comments

Comments
 (0)