drivers/net: use tasklet_kill in device remove/close process
Subsystems (7)
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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
From: Xiaotian Feng <[email protected]>
Date: Wed, 31 Oct 2012 18:29:57 +0800
Quoted 8 lines
Some driver uses
tasklet_disablein device remove/close process,tasklet_disablewill inctasklet->countand return. If the tasklet is not handled yet because some softirq pressure, the tasklet will placed on thetasklet_vec, never have a chance to excute. This might lead to ksoftirqd heavy loaded, wakeup withpending_softirq, but tasklet is disabled.tasklet_killshould be used in this case.Signed-off-by Xiaotian Feng <[email protected]>
Applied.