[PATCH v3 05/34] dmaengine: ep93xx: hook callbacks via dmaengine BH
Allen Pais <[email protected]>
| Newsgroups | org.kernel.vger.linux-kernel,org.kernel.vger.dmaengine |
|---|---|
| Message-ID | <69b17379bf3c78b6af96dbe3b76940520d491417.1786384168.git.allen.lkml@gmail.com> |
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]> --- drivers/dma/ep93xx_dma.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/drivers/dma/ep93xx_dma.c b/drivers/dma/ep93xx_dma.c index 311e55a97ba9..d79e278fb7ba 100644 --- a/drivers/dma/ep93xx_dma.c +++ b/drivers/dma/ep93xx_dma.c @@ -167,7 +167,6 @@ struct ep93xx_dma_chan_cfg { * @dma_cfg: channel number, direction * @irq: interrupt number of the channel * @clk: clock used by this channel - * @tasklet: channel specific tasklet used for callbacks * @lock: lock protecting the fields following * @flags: flags for the channel * @buffer: which buffer to use next (0/1) @@ -196,7 +195,6 @@ struct ep93xx_dma_chan { struct ep93xx_dma_chan_cfg dma_cfg; int irq; struct clk *clk; - struct tasklet_struct tasklet; /* protects the fields following */ spinlock_t lock; unsigned long flags; @@ -801,9 +799,9 @@ static void ep93xx_dma_advance_work(struct ep93xx_dma_chan *edmac) spin_unlock_irqrestore(&edmac->lock, flags); } -static void ep93xx_dma_tasklet(struct tasklet_struct *t) +static void ep93xx_dma_tasklet(struct dma_chan *chan) { - struct ep93xx_dma_chan *edmac = from_tasklet(edmac, t, tasklet); + struct ep93xx_dma_chan *edmac = to_ep93xx_dma_chan(chan); struct ep93xx_dma_desc *desc, *d; struct dmaengine_desc_callback cb; LIST_HEAD(list); @@ -858,12 +856,12 @@ static irqreturn_t ep93xx_dma_interrupt(int irq, void *dev_id) switch (edmac->edma->hw_interrupt(edmac)) { case INTERRUPT_DONE: desc->complete = true; - tasklet_schedule(&edmac->tasklet); + dmaengine_schedule_bh(&edmac->chan); break; case INTERRUPT_NEXT_BUFFER: if (test_bit(EP93XX_DMA_IS_CYCLIC, &edmac->flags)) - tasklet_schedule(&edmac->tasklet); + dmaengine_schedule_bh(&edmac->chan); break; default: @@ -1420,7 +1418,7 @@ static struct ep93xx_dma_engine *ep93xx_dma_of_probe(struct platform_device *pde INIT_LIST_HEAD(&edmac->active); INIT_LIST_HEAD(&edmac->queue); INIT_LIST_HEAD(&edmac->free_list); - tasklet_setup(&edmac->tasklet, ep93xx_dma_tasklet); + dmaengine_init_bh(&edmac->chan, ep93xx_dma_tasklet); list_add_tail(&edmac->chan.device_node, &dma_dev->channels); -- 2.43.0