Skip to content

Commit ba99c62

Browse files
Yanqing WangPaolo Abeni
authored andcommitted
driver: net: ethernet: mtk_star_emac: fix suspend/resume issue
Identify the cause of the suspend/resume hang: netif_carrier_off() is called during link state changes and becomes stuck while executing linkwatch_work(). To resolve this issue, call netif_device_detach() during the Ethernet suspend process to temporarily detach the network device from the kernel and prevent the suspend/resume hang. Fixes: 8c7bd5a ("net: ethernet: mtk-star-emac: new driver") Signed-off-by: Yanqing Wang <ot_yanqing.wang@mediatek.com> Signed-off-by: Macpaul Lin <macpaul.lin@mediatek.com> Signed-off-by: Biao Huang <biao.huang@mediatek.com> Link: https://patch.msgid.link/20250528075351.593068-1-macpaul.lin@mediatek.com Signed-off-by: Paolo Abeni <pabeni@redhat.com>
1 parent 4257271 commit ba99c62

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

drivers/net/ethernet/mediatek/mtk_star_emac.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1463,6 +1463,8 @@ static __maybe_unused int mtk_star_suspend(struct device *dev)
14631463
if (netif_running(ndev))
14641464
mtk_star_disable(ndev);
14651465

1466+
netif_device_detach(ndev);
1467+
14661468
clk_bulk_disable_unprepare(MTK_STAR_NCLKS, priv->clks);
14671469

14681470
return 0;
@@ -1487,6 +1489,8 @@ static __maybe_unused int mtk_star_resume(struct device *dev)
14871489
clk_bulk_disable_unprepare(MTK_STAR_NCLKS, priv->clks);
14881490
}
14891491

1492+
netif_device_attach(ndev);
1493+
14901494
return ret;
14911495
}
14921496

0 commit comments

Comments
 (0)