Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

dmaengine: sh: rz-dmac: Fix rz_dmac_terminate_all()

After audio full duplex testing, playing the recorded file contains a few
playback frames from the previous time. The rz_dmac_terminate_all() does
not reset all the hardware descriptors queued previously, leading to the
wrong descriptor being picked up during the next DMA transfer. Fix the
above issue by resetting all the descriptor headers for a channel in
rz_dmac_terminate_all() as rz_dmac_lmdesc_recycle() points to the proper
descriptor header filled by the rz_dmac_prepare_descs_for_slave_sg().

Cc: stable@kernel.org
Fixes: 5000d37042a6 ("dmaengine: sh: Add DMAC driver for RZ/G2L SoC")
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
Reviewed-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
Tested-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
Link: https://patch.msgid.link/20251113195052.564338-1-biju.das.jz@bp.renesas.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>

authored by

Biju Das and committed by
Vinod Koul
747213b0 c0732fe7

+5
+5
drivers/dma/sh/rz-dmac.c
··· 557 557 static int rz_dmac_terminate_all(struct dma_chan *chan) 558 558 { 559 559 struct rz_dmac_chan *channel = to_rz_dmac_chan(chan); 560 + struct rz_lmdesc *lmdesc = channel->lmdesc.base; 560 561 unsigned long flags; 562 + unsigned int i; 561 563 LIST_HEAD(head); 562 564 563 565 rz_dmac_disable_hw(channel); 564 566 spin_lock_irqsave(&channel->vc.lock, flags); 567 + for (i = 0; i < DMAC_NR_LMDESC; i++) 568 + lmdesc[i].header = 0; 569 + 565 570 list_splice_tail_init(&channel->ld_active, &channel->ld_free); 566 571 list_splice_tail_init(&channel->ld_queue, &channel->ld_free); 567 572 vchan_get_all_descriptors(&channel->vc, &head);