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: 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>

authored by

John Madieu and committed by
Vinod Koul
bfaa60be be25945d

+2 -8
+2 -8
drivers/dma/sh/rz-dmac.c
··· 460 460 { 461 461 struct rz_dmac_chan *channel = to_rz_dmac_chan(chan); 462 462 struct rz_dmac *dmac = to_rz_dmac(chan->device); 463 - struct rz_lmdesc *lmdesc = channel->lmdesc.base; 464 463 struct rz_dmac_desc *desc, *_desc; 465 464 unsigned long flags; 466 - unsigned int i; 467 465 468 466 spin_lock_irqsave(&channel->vc.lock, flags); 469 467 470 - for (i = 0; i < DMAC_NR_LMDESC; i++) 471 - lmdesc[i].header = 0; 468 + rz_lmdesc_setup(channel, channel->lmdesc.base); 472 469 473 470 rz_dmac_disable_hw(channel); 474 471 list_splice_tail_init(&channel->ld_active, &channel->ld_free); ··· 557 560 static int rz_dmac_terminate_all(struct dma_chan *chan) 558 561 { 559 562 struct rz_dmac_chan *channel = to_rz_dmac_chan(chan); 560 - struct rz_lmdesc *lmdesc = channel->lmdesc.base; 561 563 unsigned long flags; 562 - unsigned int i; 563 564 LIST_HEAD(head); 564 565 565 566 spin_lock_irqsave(&channel->vc.lock, flags); 566 567 rz_dmac_disable_hw(channel); 567 - for (i = 0; i < DMAC_NR_LMDESC; i++) 568 - lmdesc[i].header = 0; 568 + rz_lmdesc_setup(channel, channel->lmdesc.base); 569 569 570 570 list_splice_tail_init(&channel->ld_active, &channel->ld_free); 571 571 list_splice_tail_init(&channel->ld_queue, &channel->ld_free);