Skip to content

Commit

Permalink
drivers/net: use tasklet_kill in device remove/close process
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Xiaotian Feng authored and David S. Miller committed Nov 3, 2012
1 parent d145f7e commit 175c0df
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions drivers/net/ethernet/jme.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/ethernet/marvell/skge.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions drivers/net/ethernet/micrel/ksz884x.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/ethernet/xilinx/xilinx_axienet_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/wireless/b43legacy/pio.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 175c0df

Please sign in to comment.