[PATCH 0/2] dmaengine: Kill channel tasklets in remove again

Suyuan Wang via B4 Relay posted 2 patches 9 hours ago
There is a newer version of this series
drivers/dma/at_xdmac.c | 4 +++-
drivers/dma/idma64.c   | 4 +++-
2 files changed, 6 insertions(+), 2 deletions(-)
[PATCH 0/2] dmaengine: Kill channel tasklets in remove again
Posted by Suyuan Wang via B4 Relay 9 hours ago
at_xdmac and idma64 kill their channel tasklets in remove() with a loop
over dma.chancnt after dma_async_device_unregister(). Since commit
e81274cd6b52, dma_async_device_unregister() unregisters each channel
and decrements dma.chancnt for it, so chancnt is 0 when the loops run,
they do nothing, and a tasklet scheduled by an interrupt can run after
the devm-allocated driver data is gone. Both patches read the count
before unregistering.

These loops are also touched by Allen's "dmaengine: migrate channel
tasklets to WQ_BH" series (v4, 01/33 and 04/33), which keeps the
chancnt bound. The two fixes don't depend on that series; they make the
current tasklet cleanup work again. Whichever goes in second needs a
trivial rebase.

Found with a static analysis tool and checked by hand. Compile tested
on x86_64 with COMPILE_TEST (W=1); I don't have the hardware.

---
Suyuan Wang (2):
      dmaengine: at_xdmac: Kill the channel tasklets in remove again
      dmaengine: idma64: Kill the channel tasklets in remove again

 drivers/dma/at_xdmac.c | 4 +++-
 drivers/dma/idma64.c   | 4 +++-
 2 files changed, 6 insertions(+), 2 deletions(-)