diff options
author | Sean Wang <sean.wang@mediatek.com> | 2016-09-01 10:47:32 +0800 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-08-31 20:53:48 -0700 |
commit | 79e9a41438527a4cc2b426a2dfb92cd0825d7d29 (patch) | |
tree | 8ce6cbc46475cf7182a7a7c6550c8964896a983b /drivers/net/ethernet/mediatek | |
parent | 7c6b0d76fa02213393815e3b6d5e4a415bf3f0e2 (diff) |
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: Sean Wang <sean.wang@mediatek.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/mediatek')
-rw-r--r-- | drivers/net/ethernet/mediatek/mtk_eth_soc.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.c b/drivers/net/ethernet/mediatek/mtk_eth_soc.c index bf5b7e1d9450..556951e66978 100644 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c @@ -1906,6 +1906,14 @@ err_free_dev: static int mtk_remove(struct platform_device *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_ESW]); |