Skip to content

Commit

Permalink
dmaengine: dw-axi-dmac: Only start idle channels
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
pelwell committed Nov 13, 2024
1 parent 66aef6c commit 767a31f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 767a31f

Please sign in to comment.