Fix tasklet lifetime management in the ioat driver causing ksoftirqd to
spin indefinitely.

ioat: fix tasklet tear down

Since commit 77873803363c "net_dma: mark broken" we no longer pin dma
engines active for the network-receive-offload use case.  As a result
the ->free_chan_resources() that occurs after the driver self test no
longer has a NET_DMA induced ->alloc_chan_resources() to back it up.  A
late firing irq can lead to ksoftirqd spinning indefinitely due to the
tasklet_disable() performed by ->free_chan_resources().  Only
->alloc_chan_resources() can clear this condition in affected kernels.

This problem has been present since commit 3e037454bcfa "I/OAT: Add
support for MSI and MSI-X" in 2.6.24, but is now exposed. Given the
NET_DMA use case is deprecated we can revisit moving the driver to use
threaded irqs.  For now, just tear down the irq and tasklet properly by:

1/ Disable the irq from triggering the tasklet

2/ Disable the irq from re-arming

3/ Flush inflight interrupts

4/ Flush the timer

5/ Flush inflight tasklets


Cc: Ingo Molnar <>
Cc: Steven Rostedt <>
Cc: <>
Reported-by: Mike Galbraith <>
Reported-by: Stanislav Fomichev <>
Tested-by: Mike Galbraith <>
Tested-by: Stanislav Fomichev <>
Reviewed-by: Thomas Gleixner <>
Signed-off-by: Dan Williams <>
4 files changed