Commit d46f5e4a authored by Robert Jarzmik's avatar Robert Jarzmik Committed by Eric Miao

[ARM] pxa/dma: optimize irq handler loop

Reduce loop for dma irq handler callbacks to the minimum
required.

Since V1: included suggestion from Nicolas Pitre to improve
even further the loop.
Signed-off-by: default avatarRobert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: default avatarEric Miao <eric.y.miao@gmail.com>
parent 43c6342b
...@@ -94,20 +94,21 @@ EXPORT_SYMBOL(pxa_free_dma); ...@@ -94,20 +94,21 @@ EXPORT_SYMBOL(pxa_free_dma);
static irqreturn_t dma_irq_handler(int irq, void *dev_id) static irqreturn_t dma_irq_handler(int irq, void *dev_id)
{ {
int i, dint = DINT; int i, dint = DINT;
struct dma_channel *channel;
for (i = 0; i < num_dma_channels; i++) {
if (dint & (1 << i)) { while (dint) {
struct dma_channel *channel = &dma_channels[i]; i = __ffs(dint);
if (channel->name && channel->irq_handler) { dint &= (dint - 1);
channel->irq_handler(i, channel->data); channel = &dma_channels[i];
} else { if (channel->name && channel->irq_handler) {
/* channel->irq_handler(i, channel->data);
* IRQ for an unregistered DMA channel: } else {
* let's clear the interrupts and disable it. /*
*/ * IRQ for an unregistered DMA channel:
printk (KERN_WARNING "spurious IRQ for DMA channel %d\n", i); * let's clear the interrupts and disable it.
DCSR(i) = DCSR_STARTINTR|DCSR_ENDINTR|DCSR_BUSERR; */
} printk (KERN_WARNING "spurious IRQ for DMA channel %d\n", i);
DCSR(i) = DCSR_STARTINTR|DCSR_ENDINTR|DCSR_BUSERR;
} }
} }
return IRQ_HANDLED; return IRQ_HANDLED;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment