From 767a31f2e409af905af4b5dde69baabef78ab22c Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 13 Nov 2024 10:37:22 +0000 Subject: [PATCH] dmaengine: dw-axi-dmac: Only start idle channels Attempting to start a non-idle channel causes an error message to be logged, and is inefficient. Test for emptiness of the desc_issued list before doing so. Signed-off-by: Phil Elwell --- drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c b/drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c index 1d05b5d95ff8a7..acd0833b7bd48a 100644 --- a/drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c +++ b/drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c @@ -536,9 +536,11 @@ static void dma_chan_issue_pending(struct dma_chan *dchan) { struct axi_dma_chan *chan = dchan_to_axi_dma_chan(dchan); unsigned long flags; + bool was_empty; spin_lock_irqsave(&chan->vc.lock, flags); - if (vchan_issue_pending(&chan->vc)) + was_empty = list_empty(&chan->vc.desc_issued); + if (vchan_issue_pending(&chan->vc) && was_empty) axi_chan_start_first_queued(chan); spin_unlock_irqrestore(&chan->vc.lock, flags); }