Skip to content

Commit

Permalink
dmaengine: PL08x: start next descriptor from irq context
Browse files Browse the repository at this point in the history
Rather than waiting for the tasklet to run, we can start the next
descriptor from interrupt context, as soon as we know that the
previous descriptor has completed.

Acked-by: Linus Walleij <linus.walleij@linaro.org>
Tested-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
  • Loading branch information
Russell King committed Jul 1, 2012
1 parent ea16056 commit c33b644
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions drivers/dma/amba-pl08x.c
Original file line number Diff line number Diff line change
Expand Up @@ -1671,10 +1671,7 @@ static void pl08x_tasklet(unsigned long data)
spin_lock_irqsave(&plchan->lock, flags);
list_splice_tail_init(&plchan->done_list, &head);

/* If a new descriptor is queued, set it up plchan->at is NULL here */
if (!list_empty(&plchan->issued_list)) {
pl08x_start_next_txd(plchan);
} else if (!list_empty(&plchan->pend_list) || plchan->phychan_hold) {
if (plchan->at || !list_empty(&plchan->pend_list) || plchan->phychan_hold) {
/*
* This channel is still in use - we have a new txd being
* prepared and will soon be queued. Don't give up the
Expand Down Expand Up @@ -1786,6 +1783,10 @@ static irqreturn_t pl08x_irq(int irq, void *dev)
pl08x_release_mux(plchan);
dma_cookie_complete(&tx->tx);
list_add_tail(&tx->node, &plchan->done_list);

/* And start the next descriptor */
if (!list_empty(&plchan->issued_list))
pl08x_start_next_txd(plchan);
}
spin_unlock(&plchan->lock);

Expand Down

0 comments on commit c33b644

Please sign in to comment.