diff options
author | Juha Yrjola <juha.yrjola@solidboot.com> | 2006-12-06 20:13:47 -0500 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2007-05-08 15:33:31 -0400 |
commit | 3151369d7467a37386e955e6f1ba5b9b5bea7500 (patch) | |
tree | ae5e8c785c55568cb6d2012a6f73933728249fe2 | |
parent | 277d58efadd67e73aa2860e41042d8d7fc750cea (diff) |
ARM: OMAP: Add DMA IRQ sanity checks
Add DMA IRQ sanity checks
Signed-off-by: Juha Yrjola <juha.yrjola@solidboot.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
-rw-r--r-- | 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 f3f84fbf8b87..2d86b106ff3e 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) | |||
925 | { | 925 | { |
926 | u32 status = OMAP_DMA_CSR_REG(ch); | 926 | u32 status = OMAP_DMA_CSR_REG(ch); |
927 | 927 | ||
928 | if (!status) | 928 | if (!status) { |
929 | if (printk_ratelimit()) | ||
930 | printk(KERN_WARNING "Spurious DMA IRQ for lch %d\n", ch); | ||
929 | return 0; | 931 | return 0; |
930 | if (unlikely(dma_chan[ch].dev_id == -1)) | 932 | } |
933 | if (unlikely(dma_chan[ch].dev_id == -1)) { | ||
934 | if (printk_ratelimit()) | ||
935 | printk(KERN_WARNING "IRQ %04x for non-allocated DMA" | ||
936 | "channel %d\n", status, ch); | ||
931 | return 0; | 937 | return 0; |
938 | } | ||
932 | if (unlikely(status & OMAP_DMA_DROP_IRQ)) | 939 | if (unlikely(status & OMAP_DMA_DROP_IRQ)) |
933 | printk(KERN_INFO | 940 | printk(KERN_INFO |
934 | "DMA synchronization event drop occurred with device " | 941 | "DMA synchronization event drop occurred with device " |
@@ -959,11 +966,15 @@ static irqreturn_t omap2_dma_irq_handler(int irq, void *dev_id) | |||
959 | int i; | 966 | int i; |
960 | 967 | ||
961 | val = omap_readl(OMAP_DMA4_IRQSTATUS_L0); | 968 | val = omap_readl(OMAP_DMA4_IRQSTATUS_L0); |
962 | 969 | if (val == 0) { | |
963 | for (i = 1; i <= OMAP_LOGICAL_DMA_CH_COUNT; i++) { | 970 | if (printk_ratelimit()) |
964 | int active = val & (1 << (i - 1)); | 971 | printk(KERN_WARNING "Spurious DMA IRQ\n"); |
965 | if (active) | 972 | return IRQ_HANDLED; |
966 | omap2_dma_handle_ch(i - 1); | 973 | } |
974 | for (i = 0; i < OMAP_LOGICAL_DMA_CH_COUNT && val != 0; i++) { | ||
975 | if (val & 1) | ||
976 | omap2_dma_handle_ch(i); | ||
977 | val >>= 1; | ||
967 | } | 978 | } |
968 | 979 | ||
969 | return IRQ_HANDLED; | 980 | return IRQ_HANDLED; |