[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1472698055-8821-7-git-send-email-sean.wang@mediatek.com>
Date: Thu, 1 Sep 2016 10:47:32 +0800
From: <sean.wang@...iatek.com>
To: <john@...ozen.org>, <davem@...emloft.net>
CC: <nbd@...nwrt.org>, <netdev@...r.kernel.org>,
<linux-mediatek@...ts.infradead.org>, <keyhaede@...il.com>,
<objelf@...il.com>, Sean Wang <sean.wang@...iatek.com>
Subject: [PATCH net v4 6/9] net: ethernet: mediatek: fix issue of driver removal with interface is up
From: Sean Wang <sean.wang@...iatek.com>
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@...iatek.com>
---
drivers/net/ethernet/mediatek/mtk_eth_soc.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.c b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
index bf5b7e1..556951e 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]);
--
1.9.1
Powered by blists - more mailing lists