Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: 8c7bd5a454ff ("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>

authored by

Yanqing Wang and committed by
Paolo Abeni
ba99c627 4257271d

+4
+4
drivers/net/ethernet/mediatek/mtk_star_emac.c
··· 1463 1463 if (netif_running(ndev)) 1464 1464 mtk_star_disable(ndev); 1465 1465 1466 + netif_device_detach(ndev); 1467 + 1466 1468 clk_bulk_disable_unprepare(MTK_STAR_NCLKS, priv->clks); 1467 1469 1468 1470 return 0; ··· 1488 1486 if (ret) 1489 1487 clk_bulk_disable_unprepare(MTK_STAR_NCLKS, priv->clks); 1490 1488 } 1489 + 1490 + netif_device_attach(ndev); 1491 1491 1492 1492 return ret; 1493 1493 }