Re: [PATCH v3 15/34] dmaengine: pch_dma: convert tasklet to dmaengine BH
From: Frank Li
Date: Wed Sep 02 2026 - 11:15:11 EST
On Mon, Aug 10, 2026 at 11:09:16AM -0700, Allen Pais wrote:
> Replace the per-channel tasklet with the shared dmaengine BH helper.
> The handler continues to run in softirq context while dmaengine owns
> the common scheduling and teardown mechanism.
>
> Signed-off-by: Allen Pais <allen.lkml@xxxxxxxxx>
> ---
Reviewed-by: Frank Li <Frank.Li@xxxxxxx>
> drivers/dma/pch_dma.c | 14 +++++++-------
> 1 file changed, 7 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/dma/pch_dma.c b/drivers/dma/pch_dma.c
> index bf805f1024f6..eb372aa328a6 100644
> --- a/drivers/dma/pch_dma.c
> +++ b/drivers/dma/pch_dma.c
> @@ -91,7 +91,6 @@ struct pch_dma_chan {
> struct dma_chan chan;
> void __iomem *membase;
> enum dma_transfer_direction dir;
> - struct tasklet_struct tasklet;
> unsigned long err_status;
>
> spinlock_t lock;
> @@ -665,9 +664,10 @@ static int pd_device_terminate_all(struct dma_chan *chan)
> return 0;
> }
>
> -static void pdc_tasklet(struct tasklet_struct *t)
> +static void pdc_tasklet(struct dma_chan *c)
> {
> - struct pch_dma_chan *pd_chan = from_tasklet(pd_chan, t, tasklet);
> + struct pch_dma_chan *pd_chan = container_of(c, struct pch_dma_chan,
> + chan);
> unsigned long flags;
>
> if (!pdc_is_idle(pd_chan)) {
> @@ -707,7 +707,7 @@ static irqreturn_t pd_irq(int irq, void *devid)
> if (sts0 & DMA_STATUS0_ERR(i))
> set_bit(0, &pd_chan->err_status);
>
> - tasklet_schedule(&pd_chan->tasklet);
> + dmaengine_schedule_bh(&pd_chan->chan);
> ret0 = IRQ_HANDLED;
> }
> } else {
> @@ -715,7 +715,7 @@ static irqreturn_t pd_irq(int irq, void *devid)
> if (sts2 & DMA_STATUS2_ERR(i))
> set_bit(0, &pd_chan->err_status);
>
> - tasklet_schedule(&pd_chan->tasklet);
> + dmaengine_schedule_bh(&pd_chan->chan);
> ret2 = IRQ_HANDLED;
> }
> }
> @@ -877,7 +877,7 @@ static int pch_dma_probe(struct pci_dev *pdev,
> INIT_LIST_HEAD(&pd_chan->queue);
> INIT_LIST_HEAD(&pd_chan->free_list);
>
> - tasklet_setup(&pd_chan->tasklet, pdc_tasklet);
> + dmaengine_init_bh(&pd_chan->chan, pdc_tasklet);
> list_add_tail(&pd_chan->chan.device_node, &pd->dma.channels);
> }
>
> @@ -930,7 +930,7 @@ static void pch_dma_remove(struct pci_dev *pdev)
> device_node) {
> pd_chan = to_pd_chan(chan);
>
> - tasklet_kill(&pd_chan->tasklet);
> + dmaengine_kill_bh(&pd_chan->chan);
> }
>
> dma_pool_destroy(pd->pool);
> --
> 2.43.0
>