Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=3151369d7467a37386e955e6f1ba5b9b5bea7500
Commit:     3151369d7467a37386e955e6f1ba5b9b5bea7500
Parent:     277d58efadd67e73aa2860e41042d8d7fc750cea
Author:     Juha Yrjola <[EMAIL PROTECTED]>
AuthorDate: Wed Dec 6 17:13:47 2006 -0800
Committer:  Russell King <[EMAIL PROTECTED]>
CommitDate: Tue May 8 20:33:31 2007 +0100

    ARM: OMAP: Add DMA IRQ sanity checks
    
    Add DMA IRQ sanity checks
    
    Signed-off-by: Juha Yrjola <[EMAIL PROTECTED]>
    Signed-off-by: Tony Lindgren <[EMAIL PROTECTED]>
    Signed-off-by: Russell King <[EMAIL PROTECTED]>
---
 arch/arm/plat-omap/dma.c |   25 ++++++++++++++++++-------
 1 files changed, 18 insertions(+), 7 deletions(-)

diff --git a/arch/arm/plat-omap/dma.c b/arch/arm/plat-omap/dma.c
index f3f84fb..2d86b10 100644
--- a/arch/arm/plat-omap/dma.c
+++ b/arch/arm/plat-omap/dma.c
@@ -925,10 +925,17 @@ static int omap2_dma_handle_ch(int ch)
 {
        u32 status = OMAP_DMA_CSR_REG(ch);
 
-       if (!status)
+       if (!status) {
+               if (printk_ratelimit())
+                       printk(KERN_WARNING "Spurious DMA IRQ for lch %d\n", 
ch);
                return 0;
-       if (unlikely(dma_chan[ch].dev_id == -1))
+       }
+       if (unlikely(dma_chan[ch].dev_id == -1)) {
+               if (printk_ratelimit())
+                       printk(KERN_WARNING "IRQ %04x for non-allocated DMA"
+                                       "channel %d\n", status, ch);
                return 0;
+       }
        if (unlikely(status & OMAP_DMA_DROP_IRQ))
                printk(KERN_INFO
                       "DMA synchronization event drop occurred with device "
@@ -959,11 +966,15 @@ static irqreturn_t omap2_dma_irq_handler(int irq, void 
*dev_id)
        int i;
 
        val = omap_readl(OMAP_DMA4_IRQSTATUS_L0);
-
-       for (i = 1; i <= OMAP_LOGICAL_DMA_CH_COUNT; i++) {
-               int active = val & (1 << (i - 1));
-               if (active)
-                       omap2_dma_handle_ch(i - 1);
+       if (val == 0) {
+               if (printk_ratelimit())
+                       printk(KERN_WARNING "Spurious DMA IRQ\n");
+               return IRQ_HANDLED;
+       }
+       for (i = 0; i < OMAP_LOGICAL_DMA_CH_COUNT && val != 0; i++) {
+               if (val & 1)
+                       omap2_dma_handle_ch(i);
+               val >>= 1;
        }
 
        return IRQ_HANDLED;
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to