[PATCH v3 00/34] dmaengine: migrate channel tasklets to WQ_BH

Allen Pais posted 34 patches 1 month, 2 weeks ago
drivers/dma/altera-msgdma.c                   | 14 +--
drivers/dma/apple-admac.c                     | 16 ++--
drivers/dma/at_xdmac.c                        | 13 ++-
drivers/dma/bcm2835-dma.c                     |  2 +-
drivers/dma/dma-axi-dmac.c                    | 10 ++-
drivers/dma/dma-jz4780.c                      |  2 +-
drivers/dma/dmaengine.c                       | 89 ++++++++++++++++++-
.../dma/dw-axi-dmac/dw-axi-dmac-platform.c    |  2 +-
drivers/dma/dw-edma/dw-edma-core.c            |  2 +-
drivers/dma/dw/core.c                         | 42 +++++++--
drivers/dma/dw/regs.h                         |  1 +
drivers/dma/ep93xx_dma.c                      | 12 ++-
drivers/dma/fsl-edma-common.c                 |  2 +-
drivers/dma/fsl-qdma.c                        |  2 +-
drivers/dma/fsl_raid.c                        | 11 +--
drivers/dma/fsl_raid.h                        |  1 -
drivers/dma/fsldma.c                          | 10 +--
drivers/dma/fsldma.h                          |  1 -
drivers/dma/hisi_dma.c                        |  2 +-
drivers/dma/hsu/hsu.c                         |  2 +-
drivers/dma/idma64.c                          |  4 +-
drivers/dma/img-mdc-dma.c                     |  2 +-
drivers/dma/imx-dma.c                         | 26 +++---
drivers/dma/imx-sdma.c                        |  4 +-
drivers/dma/ioat/dma.c                        | 14 +--
drivers/dma/ioat/dma.h                        |  3 +-
drivers/dma/ioat/init.c                       |  2 +-
drivers/dma/k3dma.c                           |  2 +-
drivers/dma/loongson/loongson1-apb-dma.c      |  2 +-
drivers/dma/mediatek/mtk-cqdma.c              |  2 +-
drivers/dma/mediatek/mtk-hsdma.c              |  2 +-
drivers/dma/mediatek/mtk-uart-apdma.c         |  4 +-
drivers/dma/mmp_pdma.c                        | 13 ++-
drivers/dma/mmp_tdma.c                        |  9 +-
drivers/dma/mpc512x_dma.c                     | 74 +++++++++------
drivers/dma/mv_xor.c                          | 12 +--
drivers/dma/mv_xor.h                          |  2 -
drivers/dma/mv_xor_v2.c                       | 20 ++---
drivers/dma/mxs-dma.c                         | 11 ++-
drivers/dma/nbpfaxi.c                         | 13 ++-
drivers/dma/owl-dma.c                         |  2 +-
drivers/dma/pch_dma.c                         | 14 +--
drivers/dma/pl330.c                           | 18 ++--
drivers/dma/plx_dma.c                         | 12 +--
drivers/dma/ppc4xx/adma.c                     | 14 +--
drivers/dma/ppc4xx/adma.h                     |  2 -
drivers/dma/pxa_dma.c                         |  2 +-
drivers/dma/qcom/bam_dma.c                    |  4 +-
drivers/dma/qcom/gpi.c                        | 17 +++-
drivers/dma/qcom/hidma.c                      | 18 +++-
drivers/dma/qcom/qcom_adm.c                   |  4 +-
drivers/dma/sa11x0-dma.c                      |  2 +-
drivers/dma/sf-pdma/sf-pdma.c                 | 14 ++-
drivers/dma/sprd-dma.c                        |  2 +-
drivers/dma/st_fdma.c                         |  2 +-
drivers/dma/ste_dma40.c                       | 13 ++-
drivers/dma/sun6i-dma.c                       |  2 +-
drivers/dma/switchtec_dma.c                   | 16 ++--
drivers/dma/tegra186-gpc-dma.c                |  2 +-
drivers/dma/tegra20-apb-dma.c                 | 18 ++--
drivers/dma/tegra210-adma.c                   |  2 +-
drivers/dma/ti/edma.c                         |  2 +-
drivers/dma/ti/k3-udma.c                      | 12 +--
drivers/dma/ti/omap-dma.c                     |  2 +-
drivers/dma/timb_dma.c                        | 21 +++--
drivers/dma/txx9dmac.c                        | 12 +--
drivers/dma/txx9dmac.h                        |  1 -
drivers/dma/virt-dma.c                        | 12 +--
drivers/dma/virt-dma.h                        |  7 +-
drivers/dma/xgene-dma.c                       | 19 ++--
drivers/dma/xilinx/xilinx_dma.c               | 20 ++---
drivers/dma/xilinx/xilinx_dpdma.c             |  1 +
drivers/dma/xilinx/zynqmp_dma.c               | 19 ++--
include/linux/dmaengine.h                     | 28 ++++++
74 files changed, 482 insertions(+), 311 deletions(-)
[PATCH v3 00/34] dmaengine: migrate channel tasklets to WQ_BH
Posted by Allen Pais 1 month, 2 weeks ago
Hi Arnd, Vinod and Frank,

This series moves DMAengine client completion bottom halves from private
tasklets to a common per-channel API backed by WQ_BH.

The first patch introduces the dmaengine_*_bh() API with a tasklet backend
and converts virt-dma to it. It also updates every driver that directly
accesses the removed virt_dma_chan tasklet, keeping the patch buildable on
its own. This separates the driver-facing API from its implementation
without changing callback context.

The second patch switches that backend to a dedicated WQ_BH | WQ_PERCPU
workqueue. WQ_BH keeps callbacks in softirq context, while the common API
centralizes initialization, scheduling, and synchronization. The
workqueue helpers remain internal to DMAengine, and dmaengine_kill_bh()
drains scheduled callbacks to preserve tasklet_kill() semantics.

The remaining patches convert driver-owned channel completion tasklets.
Tasklets used for controller-level processing, recovery, or other
non-client-callback work are deliberately left alone because the
appropriate replacement may differ by driver.

As agreed in the RFC discussion, selecting hardirq callback delivery is a
separate API change and is not part of this series.

Earlier discussion:
https://lore.kernel.org/all/20260108080332.2341725-1-allen.lkml@gmail.com/

v2:
https://lore.kernel.org/all/cover.1785183549.git.allen.lkml@gmail.com/

Changes since v2:
- rename the new public helpers and callback type from dma_chan_* to
  dmaengine_* as requested by Vinod
- update all direct virt_dma_chan tasklet users in patch 1, fixing the
  intermediate build failures reported by Sashiko
- fold the resulting 30 empty teardown patches, reducing the series from
  64 to 34 patches without dropping any driver changes
- rebase from Linux 7.2-rc5 to d58772d8520c (latest Linus master)

Review tags retained on unchanged standalone patches:
- 09/34 IOAT: Acked-by Dave Jiang
- 17/34 STE DMA40: Reviewed-by Linus Walleij
- 27/34 PLX DMA and 34/34 Switchtec: Reviewed-by Logan Gunthorpe

Review tags received on v2 patches now folded into 01/34:
- v2 41/64 HSU: Reviewed-by Andy Shevchenko
- v2 60/64 BAM DMA: Acked-by Bartosz Golaszewski

The HSU and BAM DMA changes remain in 01/34, but those patch-specific
trailers are not attached to the substantially broader 35-file patch.
Andy and Bartosz are copied here and on 01/34 for visibility.

Testing:
- x86_64 olddefconfig, make -j$(nproc) W=1 drivers/dma/
- the same DMA build with patch 1 applied independently
- scripts/checkpatch.pl --strict on all 34 patches

Allen Pais (34):
  dmaengine: add tasklet-backed channel BH helpers
  dmaengine: back channel BH helpers with WQ_BH
  dmaengine: apple-admac: use dmaengine BH callback
  dmaengine: at_xdmac: move irq bottom half to dmaengine BH
  dmaengine: ep93xx: hook callbacks via dmaengine BH
  dmaengine: fsldma: migrate tasklet to dmaengine BH
  dmaengine: fsl_raid: run completions via dmaengine BH
  dmaengine: imx-dma: flip per-chan tasklet to dmaengine BH
  dmaengine: ioat: convert cleanup tasklet to dmaengine BH
  dmaengine: mmp_pdma: replace per-chan tasklet with dmaengine BH
  dmaengine: mmp_tdma: hook completions to dmaengine BH
  dmaengine: mv_xor: convert irq tasklet to dmaengine BH
  dmaengine: mxs-dma: use dmaengine BH scheduling
  dmaengine: nbpfaxi: switch callbacks to dmaengine BH
  dmaengine: pch_dma: convert tasklet to dmaengine BH
  dmaengine: ppc4xx: replace irq tasklet with dmaengine BH
  dmaengine: ste_dma40: convert per-channel tasklet to dmaengine BH
  dmaengine: xgene-dma: wire descriptor cleanup to dmaengine BH
  dmaengine: xilinx-dma: use dmaengine BH instead of tasklets
  dmaengine: xilinx-dpdma: kill vchan BH on remove
  dmaengine: zynqmp-dma: switch completion tasklet to dmaengine BH
  dmaengine: tegra20-apb: use channel BH helpers
  dmaengine: timb_dma: route callbacks via channel BH
  dmaengine: txx9dmac: route callbacks via channel BH
  dmaengine: mv_xor_v2: use channel BH helpers
  dmaengine: mpc512x: route callbacks via channel BH
  dmaengine: plx_dma: use channel BH helpers
  dmaengine: sf-pdma: route error callbacks through channel BH
  dmaengine: pl330: route callbacks via channel BH
  dmaengine: altera-msgdma: use channel BH helpers
  dmaengine: dw: defer callbacks via channel BH
  dmaengine: hidma: defer callbacks via channel BH
  dmaengine: qcom-gpi: defer callbacks via vchan
  dmaengine: switchtec: use channel BH helpers

 drivers/dma/altera-msgdma.c                   | 14 +--
 drivers/dma/apple-admac.c                     | 16 ++--
 drivers/dma/at_xdmac.c                        | 13 ++-
 drivers/dma/bcm2835-dma.c                     |  2 +-
 drivers/dma/dma-axi-dmac.c                    | 10 ++-
 drivers/dma/dma-jz4780.c                      |  2 +-
 drivers/dma/dmaengine.c                       | 89 ++++++++++++++++++-
 .../dma/dw-axi-dmac/dw-axi-dmac-platform.c    |  2 +-
 drivers/dma/dw-edma/dw-edma-core.c            |  2 +-
 drivers/dma/dw/core.c                         | 42 +++++++--
 drivers/dma/dw/regs.h                         |  1 +
 drivers/dma/ep93xx_dma.c                      | 12 ++-
 drivers/dma/fsl-edma-common.c                 |  2 +-
 drivers/dma/fsl-qdma.c                        |  2 +-
 drivers/dma/fsl_raid.c                        | 11 +--
 drivers/dma/fsl_raid.h                        |  1 -
 drivers/dma/fsldma.c                          | 10 +--
 drivers/dma/fsldma.h                          |  1 -
 drivers/dma/hisi_dma.c                        |  2 +-
 drivers/dma/hsu/hsu.c                         |  2 +-
 drivers/dma/idma64.c                          |  4 +-
 drivers/dma/img-mdc-dma.c                     |  2 +-
 drivers/dma/imx-dma.c                         | 26 +++---
 drivers/dma/imx-sdma.c                        |  4 +-
 drivers/dma/ioat/dma.c                        | 14 +--
 drivers/dma/ioat/dma.h                        |  3 +-
 drivers/dma/ioat/init.c                       |  2 +-
 drivers/dma/k3dma.c                           |  2 +-
 drivers/dma/loongson/loongson1-apb-dma.c      |  2 +-
 drivers/dma/mediatek/mtk-cqdma.c              |  2 +-
 drivers/dma/mediatek/mtk-hsdma.c              |  2 +-
 drivers/dma/mediatek/mtk-uart-apdma.c         |  4 +-
 drivers/dma/mmp_pdma.c                        | 13 ++-
 drivers/dma/mmp_tdma.c                        |  9 +-
 drivers/dma/mpc512x_dma.c                     | 74 +++++++++------
 drivers/dma/mv_xor.c                          | 12 +--
 drivers/dma/mv_xor.h                          |  2 -
 drivers/dma/mv_xor_v2.c                       | 20 ++---
 drivers/dma/mxs-dma.c                         | 11 ++-
 drivers/dma/nbpfaxi.c                         | 13 ++-
 drivers/dma/owl-dma.c                         |  2 +-
 drivers/dma/pch_dma.c                         | 14 +--
 drivers/dma/pl330.c                           | 18 ++--
 drivers/dma/plx_dma.c                         | 12 +--
 drivers/dma/ppc4xx/adma.c                     | 14 +--
 drivers/dma/ppc4xx/adma.h                     |  2 -
 drivers/dma/pxa_dma.c                         |  2 +-
 drivers/dma/qcom/bam_dma.c                    |  4 +-
 drivers/dma/qcom/gpi.c                        | 17 +++-
 drivers/dma/qcom/hidma.c                      | 18 +++-
 drivers/dma/qcom/qcom_adm.c                   |  4 +-
 drivers/dma/sa11x0-dma.c                      |  2 +-
 drivers/dma/sf-pdma/sf-pdma.c                 | 14 ++-
 drivers/dma/sprd-dma.c                        |  2 +-
 drivers/dma/st_fdma.c                         |  2 +-
 drivers/dma/ste_dma40.c                       | 13 ++-
 drivers/dma/sun6i-dma.c                       |  2 +-
 drivers/dma/switchtec_dma.c                   | 16 ++--
 drivers/dma/tegra186-gpc-dma.c                |  2 +-
 drivers/dma/tegra20-apb-dma.c                 | 18 ++--
 drivers/dma/tegra210-adma.c                   |  2 +-
 drivers/dma/ti/edma.c                         |  2 +-
 drivers/dma/ti/k3-udma.c                      | 12 +--
 drivers/dma/ti/omap-dma.c                     |  2 +-
 drivers/dma/timb_dma.c                        | 21 +++--
 drivers/dma/txx9dmac.c                        | 12 +--
 drivers/dma/txx9dmac.h                        |  1 -
 drivers/dma/virt-dma.c                        | 12 +--
 drivers/dma/virt-dma.h                        |  7 +-
 drivers/dma/xgene-dma.c                       | 19 ++--
 drivers/dma/xilinx/xilinx_dma.c               | 20 ++---
 drivers/dma/xilinx/xilinx_dpdma.c             |  1 +
 drivers/dma/xilinx/zynqmp_dma.c               | 19 ++--
 include/linux/dmaengine.h                     | 28 ++++++
 74 files changed, 482 insertions(+), 311 deletions(-)

-- 
2.43.0
Re: [PATCH v3 00/34] dmaengine: migrate channel tasklets to WQ_BH
Posted by Frank Li 3 weeks, 5 days ago
On Mon, Aug 10, 2026 at 11:09:01AM -0700, Allen Pais wrote:
> Hi Arnd, Vinod and Frank,
>
> This series moves DMAengine client completion bottom halves from private
> tasklets to a common per-channel API backed by WQ_BH.
>
> The first patch introduces the dmaengine_*_bh() API with a tasklet backend
> and converts virt-dma to it. It also updates every driver that directly
> accesses the removed virt_dma_chan tasklet, keeping the patch buildable on
> its own. This separates the driver-facing API from its implementation
> without changing callback context.
>
> The second patch switches that backend to a dedicated WQ_BH | WQ_PERCPU
> workqueue. WQ_BH keeps callbacks in softirq context, while the common API
> centralizes initialization, scheduling, and synchronization. The
> workqueue helpers remain internal to DMAengine, and dmaengine_kill_bh()
> drains scheduled callbacks to preserve tasklet_kill() semantics.
>
> The remaining patches convert driver-owned channel completion tasklets.
> Tasklets used for controller-level processing, recovery, or other
> non-client-callback work are deliberately left alone because the
> appropriate replacement may differ by driver.
>
> As agreed in the RFC discussion, selecting hardirq callback delivery is a
> separate API change and is not part of this series.
>
> Earlier discussion:
> https://lore.kernel.org/all/20260108080332.2341725-1-allen.lkml@gmail.com/
>
> v2:
> https://lore.kernel.org/all/cover.1785183549.git.allen.lkml@gmail.com/
>
> Changes since v2:
> - rename the new public helpers and callback type from dma_chan_* to
>   dmaengine_* as requested by Vinod
> - update all direct virt_dma_chan tasklet users in patch 1, fixing the
>   intermediate build failures reported by Sashiko
> - fold the resulting 30 empty teardown patches, reducing the series from
>   64 to 34 patches without dropping any driver changes
> - rebase from Linux 7.2-rc5 to d58772d8520c (latest Linus master)
>
> Review tags retained on unchanged standalone patches:
> - 09/34 IOAT: Acked-by Dave Jiang
> - 17/34 STE DMA40: Reviewed-by Linus Walleij
> - 27/34 PLX DMA and 34/34 Switchtec: Reviewed-by Logan Gunthorpe
>
> Review tags received on v2 patches now folded into 01/34:
> - v2 41/64 HSU: Reviewed-by Andy Shevchenko
> - v2 60/64 BAM DMA: Acked-by Bartosz Golaszewski
>
> The HSU and BAM DMA changes remain in 01/34, but those patch-specific
> trailers are not attached to the substantially broader 35-file patch.
> Andy and Bartosz are copied here and on 01/34 for visibility.
>
> Testing:
> - x86_64 olddefconfig, make -j$(nproc) W=1 drivers/dma/
> - the same DMA build with patch 1 applied independently
> - scripts/checkpatch.pl --strict on all 34 patches
>
> Allen Pais (34):
>   dmaengine: add tasklet-backed channel BH helpers
>   dmaengine: back channel BH helpers with WQ_BH
>   dmaengine: apple-admac: use dmaengine BH callback
>   dmaengine: at_xdmac: move irq bottom half to dmaengine BH
>   dmaengine: ep93xx: hook callbacks via dmaengine BH
>   dmaengine: fsldma: migrate tasklet to dmaengine BH
>   dmaengine: fsl_raid: run completions via dmaengine BH
>   dmaengine: imx-dma: flip per-chan tasklet to dmaengine BH
>   dmaengine: ioat: convert cleanup tasklet to dmaengine BH
>   dmaengine: mmp_pdma: replace per-chan tasklet with dmaengine BH
>   dmaengine: mmp_tdma: hook completions to dmaengine BH
>   dmaengine: mv_xor: convert irq tasklet to dmaengine BH
>   dmaengine: mxs-dma: use dmaengine BH scheduling
>   dmaengine: nbpfaxi: switch callbacks to dmaengine BH
>   dmaengine: pch_dma: convert tasklet to dmaengine BH
>   dmaengine: ppc4xx: replace irq tasklet with dmaengine BH
>   dmaengine: ste_dma40: convert per-channel tasklet to dmaengine BH
>   dmaengine: xgene-dma: wire descriptor cleanup to dmaengine BH
>   dmaengine: xilinx-dma: use dmaengine BH instead of tasklets
>   dmaengine: xilinx-dpdma: kill vchan BH on remove
>   dmaengine: zynqmp-dma: switch completion tasklet to dmaengine BH
>   dmaengine: tegra20-apb: use channel BH helpers
>   dmaengine: timb_dma: route callbacks via channel BH
>   dmaengine: txx9dmac: route callbacks via channel BH
>   dmaengine: mv_xor_v2: use channel BH helpers
>   dmaengine: mpc512x: route callbacks via channel BH
>   dmaengine: plx_dma: use channel BH helpers
>   dmaengine: sf-pdma: route error callbacks through channel BH
>   dmaengine: pl330: route callbacks via channel BH
>   dmaengine: altera-msgdma: use channel BH helpers
>   dmaengine: dw: defer callbacks via channel BH
>   dmaengine: hidma: defer callbacks via channel BH
>   dmaengine: qcom-gpi: defer callbacks via vchan
>   dmaengine: switchtec: use channel BH helpers
>
>  drivers/dma/altera-msgdma.c                   | 14 +--
>  drivers/dma/apple-admac.c                     | 16 ++--
>  drivers/dma/at_xdmac.c                        | 13 ++-
>  drivers/dma/bcm2835-dma.c                     |  2 +-
>  drivers/dma/dma-axi-dmac.c                    | 10 ++-
>  drivers/dma/dma-jz4780.c                      |  2 +-
>  drivers/dma/dmaengine.c                       | 89 ++++++++++++++++++-
>  .../dma/dw-axi-dmac/dw-axi-dmac-platform.c    |  2 +-
>  drivers/dma/dw-edma/dw-edma-core.c            |  2 +-
>  drivers/dma/dw/core.c                         | 42 +++++++--
>  drivers/dma/dw/regs.h                         |  1 +
>  drivers/dma/ep93xx_dma.c                      | 12 ++-
>  drivers/dma/fsl-edma-common.c                 |  2 +-
>  drivers/dma/fsl-qdma.c                        |  2 +-
>  drivers/dma/fsl_raid.c                        | 11 +--
>  drivers/dma/fsl_raid.h                        |  1 -
>  drivers/dma/fsldma.c                          | 10 +--
>  drivers/dma/fsldma.h                          |  1 -
>  drivers/dma/hisi_dma.c                        |  2 +-
>  drivers/dma/hsu/hsu.c                         |  2 +-
>  drivers/dma/idma64.c                          |  4 +-
>  drivers/dma/img-mdc-dma.c                     |  2 +-
>  drivers/dma/imx-dma.c                         | 26 +++---
>  drivers/dma/imx-sdma.c                        |  4 +-
>  drivers/dma/ioat/dma.c                        | 14 +--
>  drivers/dma/ioat/dma.h                        |  3 +-
>  drivers/dma/ioat/init.c                       |  2 +-
>  drivers/dma/k3dma.c                           |  2 +-
>  drivers/dma/loongson/loongson1-apb-dma.c      |  2 +-
>  drivers/dma/mediatek/mtk-cqdma.c              |  2 +-
>  drivers/dma/mediatek/mtk-hsdma.c              |  2 +-
>  drivers/dma/mediatek/mtk-uart-apdma.c         |  4 +-
>  drivers/dma/mmp_pdma.c                        | 13 ++-
>  drivers/dma/mmp_tdma.c                        |  9 +-
>  drivers/dma/mpc512x_dma.c                     | 74 +++++++++------
>  drivers/dma/mv_xor.c                          | 12 +--
>  drivers/dma/mv_xor.h                          |  2 -
>  drivers/dma/mv_xor_v2.c                       | 20 ++---
>  drivers/dma/mxs-dma.c                         | 11 ++-
>  drivers/dma/nbpfaxi.c                         | 13 ++-
>  drivers/dma/owl-dma.c                         |  2 +-
>  drivers/dma/pch_dma.c                         | 14 +--
>  drivers/dma/pl330.c                           | 18 ++--
>  drivers/dma/plx_dma.c                         | 12 +--
>  drivers/dma/ppc4xx/adma.c                     | 14 +--
>  drivers/dma/ppc4xx/adma.h                     |  2 -
>  drivers/dma/pxa_dma.c                         |  2 +-
>  drivers/dma/qcom/bam_dma.c                    |  4 +-
>  drivers/dma/qcom/gpi.c                        | 17 +++-
>  drivers/dma/qcom/hidma.c                      | 18 +++-
>  drivers/dma/qcom/qcom_adm.c                   |  4 +-
>  drivers/dma/sa11x0-dma.c                      |  2 +-
>  drivers/dma/sf-pdma/sf-pdma.c                 | 14 ++-
>  drivers/dma/sprd-dma.c                        |  2 +-
>  drivers/dma/st_fdma.c                         |  2 +-
>  drivers/dma/ste_dma40.c                       | 13 ++-
>  drivers/dma/sun6i-dma.c                       |  2 +-
>  drivers/dma/switchtec_dma.c                   | 16 ++--
>  drivers/dma/tegra186-gpc-dma.c                |  2 +-
>  drivers/dma/tegra20-apb-dma.c                 | 18 ++--
>  drivers/dma/tegra210-adma.c                   |  2 +-
>  drivers/dma/ti/edma.c                         |  2 +-
>  drivers/dma/ti/k3-udma.c                      | 12 +--
>  drivers/dma/ti/omap-dma.c                     |  2 +-
>  drivers/dma/timb_dma.c                        | 21 +++--
>  drivers/dma/txx9dmac.c                        | 12 +--
>  drivers/dma/txx9dmac.h                        |  1 -
>  drivers/dma/virt-dma.c                        | 12 +--
>  drivers/dma/virt-dma.h                        |  7 +-
>  drivers/dma/xgene-dma.c                       | 19 ++--
>  drivers/dma/xilinx/xilinx_dma.c               | 20 ++---
>  drivers/dma/xilinx/xilinx_dpdma.c             |  1 +
>  drivers/dma/xilinx/zynqmp_dma.c               | 19 ++--

There are some dmaengine code out of drivers/dma tree. Do you plan to
convert it also

Frank

>  include/linux/dmaengine.h                     | 28 ++++++
>  74 files changed, 482 insertions(+), 311 deletions(-)
>
> --
> 2.43.0
Re: [PATCH v3 00/34] dmaengine: migrate channel tasklets to WQ_BH
Posted by Andy Shevchenko 1 month, 2 weeks ago
On Mon, Aug 10, 2026 at 11:09:01AM -0700, Allen Pais wrote:
> Hi Arnd, Vinod and Frank,
> 
> This series moves DMAengine client completion bottom halves from private
> tasklets to a common per-channel API backed by WQ_BH.
> 
> The first patch introduces the dmaengine_*_bh() API with a tasklet backend
> and converts virt-dma to it. It also updates every driver that directly
> accesses the removed virt_dma_chan tasklet, keeping the patch buildable on
> its own. This separates the driver-facing API from its implementation
> without changing callback context.
> 
> The second patch switches that backend to a dedicated WQ_BH | WQ_PERCPU
> workqueue. WQ_BH keeps callbacks in softirq context, while the common API
> centralizes initialization, scheduling, and synchronization. The
> workqueue helpers remain internal to DMAengine, and dmaengine_kill_bh()
> drains scheduled callbacks to preserve tasklet_kill() semantics.
> 
> The remaining patches convert driver-owned channel completion tasklets.
> Tasklets used for controller-level processing, recovery, or other
> non-client-callback work are deliberately left alone because the
> appropriate replacement may differ by driver.
> 
> As agreed in the RFC discussion, selecting hardirq callback delivery is a
> separate API change and is not part of this series.
> 
> Earlier discussion:
> https://lore.kernel.org/all/20260108080332.2341725-1-allen.lkml@gmail.com/

Never reply with a new version of such a long series into the same thread (of
the previous version of it), it's now a mess in the mail thread.

-- 
With Best Regards,
Andy Shevchenko
Re: [PATCH v3 00/34] dmaengine: migrate channel tasklets to WQ_BH
Posted by Andy Shevchenko 1 month, 2 weeks ago
On Mon, Aug 10, 2026 at 11:09:01AM -0700, Allen Pais wrote:
> 
> This series moves DMAengine client completion bottom halves from private
> tasklets to a common per-channel API backed by WQ_BH.
> 
> The first patch introduces the dmaengine_*_bh() API with a tasklet backend
> and converts virt-dma to it. It also updates every driver that directly
> accesses the removed virt_dma_chan tasklet, keeping the patch buildable on
> its own. This separates the driver-facing API from its implementation
> without changing callback context.
> 
> The second patch switches that backend to a dedicated WQ_BH | WQ_PERCPU
> workqueue. WQ_BH keeps callbacks in softirq context, while the common API
> centralizes initialization, scheduling, and synchronization. The
> workqueue helpers remain internal to DMAengine, and dmaengine_kill_bh()
> drains scheduled callbacks to preserve tasklet_kill() semantics.
> 
> The remaining patches convert driver-owned channel completion tasklets.
> Tasklets used for controller-level processing, recovery, or other
> non-client-callback work are deliberately left alone because the
> appropriate replacement may differ by driver.

Right, I would actually expect that virt-dma (and others will follow the
example) will switch to threaded IRQ instead of tasklets.

> As agreed in the RFC discussion, selecting hardirq callback delivery is a
> separate API change and is not part of this series.

-- 
With Best Regards,
Andy Shevchenko
Re: [PATCH v3 00/34] dmaengine: migrate channel tasklets to WQ_BH
Posted by Allen 1 month, 2 weeks ago
> > This series moves DMAengine client completion bottom halves from private
> > tasklets to a common per-channel API backed by WQ_BH.
> >
> > The first patch introduces the dmaengine_*_bh() API with a tasklet backend
> > and converts virt-dma to it. It also updates every driver that directly
> > accesses the removed virt_dma_chan tasklet, keeping the patch buildable on
> > its own. This separates the driver-facing API from its implementation
> > without changing callback context.
> >
> > The second patch switches that backend to a dedicated WQ_BH | WQ_PERCPU
> > workqueue. WQ_BH keeps callbacks in softirq context, while the common API
> > centralizes initialization, scheduling, and synchronization. The
> > workqueue helpers remain internal to DMAengine, and dmaengine_kill_bh()
> > drains scheduled callbacks to preserve tasklet_kill() semantics.
> >
> > The remaining patches convert driver-owned channel completion tasklets.
> > Tasklets used for controller-level processing, recovery, or other
> > non-client-callback work are deliberately left alone because the
> > appropriate replacement may differ by driver.
>
> Right, I would actually expect that virt-dma (and others will follow the
> example) will switch to threaded IRQ instead of tasklets.

Thanks, Andy.

  I had not considered a full virt-dma conversion for this series. Looking
  at the driver, that would also involve its descriptor pool, queue and
  active lists, software LLP and cyclic handling, and residue reporting. It
  would therefore be a substantially broader change than moving callback
  delivery to the common channel BH.

  My intention here was to leave the existing descriptor lifecycle and
  scheduling unchanged and only move callback invocation out of the
  controller tasklet. I think converting the driver to virt-dma would be
  better handled as a separate series with hardware testing.

  If you would prefer not to add the completed list ahead of such a
  conversion, I can drop this patch from the current series and leave the
  DW driver unchanged for now.

  Regards,
  Allen


>
> > As agreed in the RFC discussion, selecting hardirq callback delivery is a
> > separate API change and is not part of this series.
>
> --
> With Best Regards,
> Andy Shevchenko
>
>


-- 
       - Allen
Re: [PATCH v3 00/34] dmaengine: migrate channel tasklets to WQ_BH
Posted by Andy Shevchenko 1 month, 2 weeks ago
On Tue, Aug 11, 2026 at 01:44:49PM -0700, Allen wrote:

...

> > > The remaining patches convert driver-owned channel completion tasklets.
> > > Tasklets used for controller-level processing, recovery, or other
> > > non-client-callback work are deliberately left alone because the
> > > appropriate replacement may differ by driver.
> >
> > Right, I would actually expect that virt-dma (and others will follow the
> > example) will switch to threaded IRQ instead of tasklets.
> 
>   I had not considered a full virt-dma conversion for this series. Looking
>   at the driver, that would also involve its descriptor pool, queue and
>   active lists, software LLP and cyclic handling, and residue reporting. It
>   would therefore be a substantially broader change than moving callback
>   delivery to the common channel BH.
> 
>   My intention here was to leave the existing descriptor lifecycle and
>   scheduling unchanged and only move callback invocation out of the
>   controller tasklet. I think converting the driver to virt-dma would be
>   better handled as a separate series with hardware testing.
> 
>   If you would prefer not to add the completed list ahead of such a
>   conversion, I can drop this patch from the current series and leave the
>   DW driver unchanged for now.

I think this is unneeded churn for DW DMA driver. It requires a much bigger
refactoring and cleaning up.

-- 
With Best Regards,
Andy Shevchenko