diff options
author | Robert Jarzmik <robert.jarzmik@free.fr> | 2009-08-08 17:07:21 -0400 |
---|---|---|
committer | Eric Miao <eric.y.miao@gmail.com> | 2009-09-10 06:49:28 -0400 |
commit | d46f5e4a20867da84d12a35407cf7dcc8713c9cc (patch) | |
tree | d1eac7ca8e77555f7b4f321becc3ad9726b32980 /arch/arm/plat-pxa | |
parent | 43c6342b1562cc27d8ba1240220cb887ad0e36f0 (diff) |
[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: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: Eric Miao <eric.y.miao@gmail.com>
Diffstat (limited to 'arch/arm/plat-pxa')
-rw-r--r-- | arch/arm/plat-pxa/dma.c | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/arch/arm/plat-pxa/dma.c b/arch/arm/plat-pxa/dma.c index 897663dbc5f4..56b51cf0718b 100644 --- a/arch/arm/plat-pxa/dma.c +++ b/arch/arm/plat-pxa/dma.c | |||
@@ -94,20 +94,21 @@ EXPORT_SYMBOL(pxa_free_dma); | |||
94 | static irqreturn_t dma_irq_handler(int irq, void *dev_id) | 94 | static irqreturn_t dma_irq_handler(int irq, void *dev_id) |
95 | { | 95 | { |
96 | int i, dint = DINT; | 96 | int i, dint = DINT; |
97 | 97 | struct dma_channel *channel; | |
98 | for (i = 0; i < num_dma_channels; i++) { | 98 | |
99 | if (dint & (1 << i)) { | 99 | while (dint) { |
100 | struct dma_channel *channel = &dma_channels[i]; | 100 | i = __ffs(dint); |
101 | if (channel->name && channel->irq_handler) { | 101 | dint &= (dint - 1); |
102 | channel->irq_handler(i, channel->data); | 102 | channel = &dma_channels[i]; |
103 | } else { | 103 | if (channel->name && channel->irq_handler) { |
104 | /* | 104 | channel->irq_handler(i, channel->data); |
105 | * IRQ for an unregistered DMA channel: | 105 | } else { |
106 | * let's clear the interrupts and disable it. | 106 | /* |
107 | */ | 107 | * IRQ for an unregistered DMA channel: |
108 | printk (KERN_WARNING "spurious IRQ for DMA channel %d\n", i); | 108 | * let's clear the interrupts and disable it. |
109 | DCSR(i) = DCSR_STARTINTR|DCSR_ENDINTR|DCSR_BUSERR; | 109 | */ |
110 | } | 110 | printk (KERN_WARNING "spurious IRQ for DMA channel %d\n", i); |
111 | DCSR(i) = DCSR_STARTINTR|DCSR_ENDINTR|DCSR_BUSERR; | ||
111 | } | 112 | } |
112 | } | 113 | } |
113 | return IRQ_HANDLED; | 114 | return IRQ_HANDLED; |