Skip to content

Commit 8c6790b

Browse files
jianhuileePaolo Abeni
authored andcommitted
net: ethernet: mtk-star-emac: set mac_managed_pm when probing
The below commit introduced a warning message when phy state is not in the states: PHY_HALTED, PHY_READY, and PHY_UP. commit 744d23c ("net: phy: Warn about incorrect mdio_bus_phy_resume() state") mtk-star-emac doesn't need mdiobus suspend/resume. To fix the warning message during resume, indicate the phy resume/suspend is managed by the mac when probing. Fixes: 744d23c ("net: phy: Warn about incorrect mdio_bus_phy_resume() state") Signed-off-by: Jian Hui Lee <[email protected]> Reviewed-by: Jacob Keller <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Paolo Abeni <[email protected]>
1 parent 76a0a3f commit 8c6790b

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

drivers/net/ethernet/mediatek/mtk_star_emac.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1524,6 +1524,7 @@ static int mtk_star_probe(struct platform_device *pdev)
15241524
{
15251525
struct device_node *of_node;
15261526
struct mtk_star_priv *priv;
1527+
struct phy_device *phydev;
15271528
struct net_device *ndev;
15281529
struct device *dev;
15291530
void __iomem *base;
@@ -1649,6 +1650,12 @@ static int mtk_star_probe(struct platform_device *pdev)
16491650
netif_napi_add(ndev, &priv->rx_napi, mtk_star_rx_poll);
16501651
netif_napi_add_tx(ndev, &priv->tx_napi, mtk_star_tx_poll);
16511652

1653+
phydev = of_phy_find_device(priv->phy_node);
1654+
if (phydev) {
1655+
phydev->mac_managed_pm = true;
1656+
put_device(&phydev->mdio.dev);
1657+
}
1658+
16521659
return devm_register_netdev(dev, ndev);
16531660
}
16541661

0 commit comments

Comments
 (0)