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 <[email protected]> Reviewed-by: Frank Li <[email protected]> --- drivers/dma/fsldma.c | 12 ++++++------ drivers/dma/fsldma.h | 1 - 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/drivers/dma/fsldma.c b/drivers/dma/fsldma.c index 99a878ed1444..f069d1bbff17 100644 --- a/drivers/dma/fsldma.c +++ b/drivers/dma/fsldma.c @@ -970,18 +970,18 @@ static irqreturn_t fsldma_chan_irq(int irq, void *data) chan_err(chan, "irq: unhandled sr 0x%08x\n", stat); /* - * Schedule the tasklet to handle all cleanup of the current + * Queue the BH worker to handle all cleanup of the current * transaction. It will start a new transaction if there is * one pending. */ - tasklet_schedule(&chan->tasklet); + dmaengine_schedule_bh(&chan->common); chan_dbg(chan, "irq: Exit\n"); return IRQ_HANDLED; } -static void dma_do_tasklet(struct tasklet_struct *t) +static void dma_do_tasklet(struct dma_chan *c) { - struct fsldma_chan *chan = from_tasklet(chan, t, tasklet); + struct fsldma_chan *chan = to_fsl_chan(c); chan_dbg(chan, "tasklet entry\n"); @@ -1154,7 +1154,7 @@ static int fsl_dma_chan_probe(struct fsldma_device *fdev, } fdev->chan[chan->id] = chan; - tasklet_setup(&chan->tasklet, dma_do_tasklet); + dmaengine_init_bh(&chan->common, dma_do_tasklet); snprintf(chan->name, sizeof(chan->name), "chan%d", chan->id); /* Initialize the channel */ @@ -1207,7 +1207,7 @@ static int fsl_dma_chan_probe(struct fsldma_device *fdev, static void fsl_dma_chan_remove(struct fsldma_chan *chan) { - tasklet_kill(&chan->tasklet); + dmaengine_kill_bh(&chan->common); irq_dispose_mapping(chan->irq); list_del(&chan->common.device_node); iounmap(chan->regs); diff --git a/drivers/dma/fsldma.h b/drivers/dma/fsldma.h index d7b7a3138b85..cab33d010d51 100644 --- a/drivers/dma/fsldma.h +++ b/drivers/dma/fsldma.h @@ -173,7 +173,6 @@ struct fsldma_chan { struct device *dev; /* Channel device */ int irq; /* Channel IRQ */ int id; /* Raw id of this channel */ - struct tasklet_struct tasklet; u32 feature; bool idle; /* DMA controller is idle */ #ifdef CONFIG_PM -- 2.43.0
