summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Madieu <john.madieu.xa@bp.renesas.com>2026-03-16 15:32:50 +0200
committerVinod Koul <vkoul@kernel.org>2026-03-17 16:12:11 +0530
commitbfaa60be647842cece968769f208e57fa5dee594 (patch)
treee1df045e07f8f97bb70ad12278a479b7ee0c70c9
parentbe25945d0ca3ac736c448b530c47e854c82a0343 (diff)
dmaengine: sh: rz-dmac: Use rz_lmdesc_setup() to invalidate descriptors
rz_lmdesc_setup() invalidates DMA descriptors more comprehensively. It resets the base, head, and tail pointers of the descriptor list and clears the descriptor headers and their NXLA pointers. Use rz_lmdesc_setup() instead of open-coding parts of its logic. Signed-off-by: John Madieu <john.madieu.xa@bp.renesas.com> Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com> Reviewed-by: Frank Li <Frank.Li@nxp.com> Link: https://patch.msgid.link/20260316133252.240348-7-claudiu.beznea.uj@bp.renesas.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
-rw-r--r--drivers/dma/sh/rz-dmac.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/drivers/dma/sh/rz-dmac.c b/drivers/dma/sh/rz-dmac.c
index eca62d9e9772..6bfa77844e02 100644
--- a/drivers/dma/sh/rz-dmac.c
+++ b/drivers/dma/sh/rz-dmac.c
@@ -460,15 +460,12 @@ static void rz_dmac_free_chan_resources(struct dma_chan *chan)
{
struct rz_dmac_chan *channel = to_rz_dmac_chan(chan);
struct rz_dmac *dmac = to_rz_dmac(chan->device);
- struct rz_lmdesc *lmdesc = channel->lmdesc.base;
struct rz_dmac_desc *desc, *_desc;
unsigned long flags;
- unsigned int i;
spin_lock_irqsave(&channel->vc.lock, flags);
- for (i = 0; i < DMAC_NR_LMDESC; i++)
- lmdesc[i].header = 0;
+ rz_lmdesc_setup(channel, channel->lmdesc.base);
rz_dmac_disable_hw(channel);
list_splice_tail_init(&channel->ld_active, &channel->ld_free);
@@ -560,15 +557,12 @@ rz_dmac_prep_slave_sg(struct dma_chan *chan, struct scatterlist *sgl,
static int rz_dmac_terminate_all(struct dma_chan *chan)
{
struct rz_dmac_chan *channel = to_rz_dmac_chan(chan);
- struct rz_lmdesc *lmdesc = channel->lmdesc.base;
unsigned long flags;
- unsigned int i;
LIST_HEAD(head);
spin_lock_irqsave(&channel->vc.lock, flags);
rz_dmac_disable_hw(channel);
- for (i = 0; i < DMAC_NR_LMDESC; i++)
- lmdesc[i].header = 0;
+ rz_lmdesc_setup(channel, channel->lmdesc.base);
list_splice_tail_init(&channel->ld_active, &channel->ld_free);
list_splice_tail_init(&channel->ld_queue, &channel->ld_free);