aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXiaotian Feng <xtfeng@gmail.com>2012-10-30 20:29:57 -0400
committerDavid S. Miller <davem@davemloft.net>2012-11-03 15:10:15 -0400
commit175c0dffef310fc7d7f026ca4a7682beb2fbd8ec (patch)
treeb9ff3f9ae6b5a1a6e41b1b950d3820d68c5ef8ac
parentd145f7ec23b6366e2b75442eaefafa11077ed568 (diff)
drivers/net: use tasklet_kill in device remove/close process
Some driver uses tasklet_disable in device remove/close process, tasklet_disable will inc tasklet->count and return. If the tasklet is not handled yet because some softirq pressure, the tasklet will placed on the tasklet_vec, never have a chance to excute. This might lead to ksoftirqd heavy loaded, wakeup with pending_softirq, but tasklet is disabled. tasklet_kill should be used in this case. Signed-off-by: Xiaotian Feng <dannyfeng@tencent.com> Cc: "David S. Miller" <davem@davemloft.net> Cc: netdev@vger.kernel.org Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/ethernet/jme.c8
-rw-r--r--drivers/net/ethernet/marvell/skge.c2
-rw-r--r--drivers/net/ethernet/micrel/ksz884x.c4
-rw-r--r--drivers/net/ethernet/xilinx/xilinx_axienet_main.c2
-rw-r--r--drivers/net/wireless/b43legacy/pio.c2
5 files changed, 9 insertions, 9 deletions
diff --git a/drivers/net/ethernet/jme.c b/drivers/net/ethernet/jme.c
index f8064df10cc4..92317e9c0f73 100644
--- a/drivers/net/ethernet/jme.c
+++ b/drivers/net/ethernet/jme.c
@@ -1948,10 +1948,10 @@ jme_close(struct net_device *netdev)
1948 1948
1949 JME_NAPI_DISABLE(jme); 1949 JME_NAPI_DISABLE(jme);
1950 1950
1951 tasklet_disable(&jme->linkch_task); 1951 tasklet_kill(&jme->linkch_task);
1952 tasklet_disable(&jme->txclean_task); 1952 tasklet_kill(&jme->txclean_task);
1953 tasklet_disable(&jme->rxclean_task); 1953 tasklet_kill(&jme->rxclean_task);
1954 tasklet_disable(&jme->rxempty_task); 1954 tasklet_kill(&jme->rxempty_task);
1955 1955
1956 jme_disable_rx_engine(jme); 1956 jme_disable_rx_engine(jme);
1957 jme_disable_tx_engine(jme); 1957 jme_disable_tx_engine(jme);
diff --git a/drivers/net/ethernet/marvell/skge.c b/drivers/net/ethernet/marvell/skge.c
index 9b9c2ac5c4c2..d19a143aa5a8 100644
--- a/drivers/net/ethernet/marvell/skge.c
+++ b/drivers/net/ethernet/marvell/skge.c
@@ -4026,7 +4026,7 @@ static void __devexit skge_remove(struct pci_dev *pdev)
4026 dev0 = hw->dev[0]; 4026 dev0 = hw->dev[0];
4027 unregister_netdev(dev0); 4027 unregister_netdev(dev0);
4028 4028
4029 tasklet_disable(&hw->phy_task); 4029 tasklet_kill(&hw->phy_task);
4030 4030
4031 spin_lock_irq(&hw->hw_lock); 4031 spin_lock_irq(&hw->hw_lock);
4032 hw->intr_mask = 0; 4032 hw->intr_mask = 0;
diff --git a/drivers/net/ethernet/micrel/ksz884x.c b/drivers/net/ethernet/micrel/ksz884x.c
index 318fee91c79d..e558edd1cb6c 100644
--- a/drivers/net/ethernet/micrel/ksz884x.c
+++ b/drivers/net/ethernet/micrel/ksz884x.c
@@ -5407,8 +5407,8 @@ static int netdev_close(struct net_device *dev)
5407 /* Delay for receive task to stop scheduling itself. */ 5407 /* Delay for receive task to stop scheduling itself. */
5408 msleep(2000 / HZ); 5408 msleep(2000 / HZ);
5409 5409
5410 tasklet_disable(&hw_priv->rx_tasklet); 5410 tasklet_kill(&hw_priv->rx_tasklet);
5411 tasklet_disable(&hw_priv->tx_tasklet); 5411 tasklet_kill(&hw_priv->tx_tasklet);
5412 free_irq(dev->irq, hw_priv->dev); 5412 free_irq(dev->irq, hw_priv->dev);
5413 5413
5414 transmit_cleanup(hw_priv, 0); 5414 transmit_cleanup(hw_priv, 0);
diff --git a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
index 0793299bd39e..1d04754a6637 100644
--- a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
+++ b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
@@ -990,7 +990,7 @@ static int axienet_stop(struct net_device *ndev)
990 axienet_setoptions(ndev, lp->options & 990 axienet_setoptions(ndev, lp->options &
991 ~(XAE_OPTION_TXEN | XAE_OPTION_RXEN)); 991 ~(XAE_OPTION_TXEN | XAE_OPTION_RXEN));
992 992
993 tasklet_disable(&lp->dma_err_tasklet); 993 tasklet_kill(&lp->dma_err_tasklet);
994 994
995 free_irq(lp->tx_irq, ndev); 995 free_irq(lp->tx_irq, ndev);
996 free_irq(lp->rx_irq, ndev); 996 free_irq(lp->rx_irq, ndev);
diff --git a/drivers/net/wireless/b43legacy/pio.c b/drivers/net/wireless/b43legacy/pio.c
index 192251adf986..282eedec675e 100644
--- a/drivers/net/wireless/b43legacy/pio.c
+++ b/drivers/net/wireless/b43legacy/pio.c
@@ -382,7 +382,7 @@ static void cancel_transfers(struct b43legacy_pioqueue *queue)
382{ 382{
383 struct b43legacy_pio_txpacket *packet, *tmp_packet; 383 struct b43legacy_pio_txpacket *packet, *tmp_packet;
384 384
385 tasklet_disable(&queue->txtask); 385 tasklet_kill(&queue->txtask);
386 386
387 list_for_each_entry_safe(packet, tmp_packet, &queue->txrunning, list) 387 list_for_each_entry_safe(packet, tmp_packet, &queue->txrunning, list)
388 free_txpacket(packet, 0); 388 free_txpacket(packet, 0);