Commit ba99c627 authored by Yanqing Wang's avatar Yanqing Wang Committed by Paolo Abeni
Browse files

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: 8c7bd5a4 ("net: ethernet: mtk-star-emac: new driver")
Signed-off-by: default avatarYanqing Wang <ot_yanqing.wang@mediatek.com>
Signed-off-by: default avatarMacpaul Lin <macpaul.lin@mediatek.com>
Signed-off-by: default avatarBiao Huang <biao.huang@mediatek.com>
Link: https://patch.msgid.link/20250528075351.593068-1-macpaul.lin@mediatek.com


Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
parent 4257271d
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -1463,6 +1463,8 @@ static __maybe_unused int mtk_star_suspend(struct device *dev)
	if (netif_running(ndev))
		mtk_star_disable(ndev);

	netif_device_detach(ndev);

	clk_bulk_disable_unprepare(MTK_STAR_NCLKS, priv->clks);

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

	netif_device_attach(ndev);

	return ret;
}