Commit 79e9a414 authored by Sean Wang's avatar Sean Wang Committed by David S. Miller

net: ethernet: mediatek: fix issue of driver removal with interface is up

mtk_stop() must be called to stop for freeing DMA
resources acquired and restoring state changed by mtk_open()
firstly when module removal.
Signed-off-by: default avatarSean Wang <sean.wang@mediatek.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 7c6b0d76
...@@ -1906,6 +1906,14 @@ static int mtk_probe(struct platform_device *pdev) ...@@ -1906,6 +1906,14 @@ static int mtk_probe(struct platform_device *pdev)
static int mtk_remove(struct platform_device *pdev) static int mtk_remove(struct platform_device *pdev)
{ {
struct mtk_eth *eth = platform_get_drvdata(pdev); struct mtk_eth *eth = platform_get_drvdata(pdev);
int i;
/* stop all devices to make sure that dma is properly shut down */
for (i = 0; i < MTK_MAC_COUNT; i++) {
if (!eth->netdev[i])
continue;
mtk_stop(eth->netdev[i]);
}
clk_disable_unprepare(eth->clks[MTK_CLK_ETHIF]); clk_disable_unprepare(eth->clks[MTK_CLK_ETHIF]);
clk_disable_unprepare(eth->clks[MTK_CLK_ESW]); clk_disable_unprepare(eth->clks[MTK_CLK_ESW]);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment