Skip to contentSkip to conversation

drivers/net: use tasklet_kill in device remove/close process

PATCH Applied Xiaotian Feng 2 participants 2 messages Oct 31, 2012 – Nov 3, 2012

Subsystems (7)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---
 drivers/net/ethernet/jme.c                        |    8 ++++----
 drivers/net/ethernet/marvell/skge.c               |    2 +-
 drivers/net/ethernet/micrel/ksz884x.c             |    4 ++--
 drivers/net/ethernet/xilinx/xilinx_axienet_main.c |    2 +-
 drivers/net/wireless/b43legacy/pio.c              |    2 +-
 5 files changed, 9 insertions(+), 9 deletions(-)
drivers/net/ethernet/jme.c +4 -4
index 8ddf9ca..76a91f6 100644
@@ -1948,10 +1948,10 @@ jme_close(struct net_device *netdev)
 
 	JME_NAPI_DISABLE(jme);
 
-	tasklet_disable(&jme->linkch_task);
-	tasklet_disable(&jme->txclean_task);
-	tasklet_disable(&jme->rxclean_task);
-	tasklet_disable(&jme->rxempty_task);
+	tasklet_kill(&jme->linkch_task);
+	tasklet_kill(&jme->txclean_task);
+	tasklet_kill(&jme->rxclean_task);
+	tasklet_kill(&jme->rxempty_task);
 
 	jme_disable_rx_engine(jme);
 	jme_disable_tx_engine(jme);
drivers/net/ethernet/marvell/skge.c +1 -1
index 9b9c2ac..d19a143 100644
@@ -4026,7 +4026,7 @@ static void __devexit skge_remove(struct pci_dev *pdev)
 	dev0 = hw->dev[0];
 	unregister_netdev(dev0);
 
-	tasklet_disable(&hw->phy_task);
+	tasklet_kill(&hw->phy_task);
 
 	spin_lock_irq(&hw->hw_lock);
 	hw->intr_mask = 0;
drivers/net/ethernet/micrel/ksz884x.c +2 -2
index 318fee9..e558edd 100644
@@ -5407,8 +5407,8 @@ static int netdev_close(struct net_device *dev)
 		/* Delay for receive task to stop scheduling itself. */
 		msleep(2000 / HZ);
 
-		tasklet_disable(&hw_priv->rx_tasklet);
-		tasklet_disable(&hw_priv->tx_tasklet);
+		tasklet_kill(&hw_priv->rx_tasklet);
+		tasklet_kill(&hw_priv->tx_tasklet);
 		free_irq(dev->irq, hw_priv->dev);
 
 		transmit_cleanup(hw_priv, 0);
drivers/net/ethernet/xilinx/xilinx_axienet_main.c +1 -1
index 0793299..1d04754 100644
@@ -990,7 +990,7 @@ static int axienet_stop(struct net_device *ndev)
 	axienet_setoptions(ndev, lp->options &
 			   ~(XAE_OPTION_TXEN | XAE_OPTION_RXEN));
 
-	tasklet_disable(&lp->dma_err_tasklet);
+	tasklet_kill(&lp->dma_err_tasklet);
 
 	free_irq(lp->tx_irq, ndev);
 	free_irq(lp->rx_irq, ndev);
drivers/net/wireless/b43legacy/pio.c +1 -1
index 192251a..282eede 100644
@@ -382,7 +382,7 @@ static void cancel_transfers(struct b43legacy_pioqueue *queue)
 {
 	struct b43legacy_pio_txpacket *packet, *tmp_packet;
 
-	tasklet_disable(&queue->txtask);
+	tasklet_kill(&queue->txtask);
 
 	list_for_each_entry_safe(packet, tmp_packet, &queue->txrunning, list)
 		free_txpacket(packet, 0);
Signature · 1 line
1.7.9.5
maintainer Applied
#1 lore raw

From: Xiaotian Feng <[email protected]>
Date: Wed, 31 Oct 2012 18:29:57 +0800

Quoted 8 lines

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.

Applied.