]> err.no Git - linux-2.6/blobdiff - arch/arm/kernel/irq.c
Merge omap tree
[linux-2.6] / arch / arm / kernel / irq.c
index d7099dbbb879ab8cd9ed6c417bdcc87d461dd747..ec20f8935e8bec809649bafc5fd0d80f212d9861 100644 (file)
@@ -52,7 +52,7 @@
  */
 #define MAX_IRQ_CNT    100000
 
-static int noirqdebug;
+static int noirqdebug __read_mostly;
 static volatile unsigned long irq_err_count;
 static DEFINE_SPINLOCK(irq_controller_lock);
 static LIST_HEAD(irq_pending);
@@ -81,7 +81,7 @@ irqreturn_t no_action(int irq, void *dev_id, struct pt_regs *regs)
 
 void do_bad_IRQ(unsigned int irq, struct irqdesc *desc, struct pt_regs *regs)
 {
-       irq_err_count += 1;
+       irq_err_count++;
        printk(KERN_ERR "IRQ: spurious interrupt %d\n", irq);
 }
 
@@ -305,14 +305,19 @@ report_bad_irq(unsigned int irq, struct pt_regs *regs, struct irqdesc *desc, int
        static int count = 100;
        struct irqaction *action;
 
-       if (!count || noirqdebug)
+       if (noirqdebug)
                return;
 
-       count--;
-
        if (ret != IRQ_HANDLED && ret != IRQ_NONE) {
+               if (!count)
+                       return;
+               count--;
                printk("irq%u: bogus retval mask %x\n", irq, ret);
        } else {
+               desc->irqs_unhandled++;
+               if (desc->irqs_unhandled <= 99900)
+                       return;
+               desc->irqs_unhandled = 0;
                printk("irq%u: nobody cared\n", irq);
        }
        show_regs(regs);
@@ -337,10 +342,10 @@ __do_irq(unsigned int irq, struct irqaction *action, struct pt_regs *regs)
 
 #ifdef CONFIG_NO_IDLE_HZ
        if (!(action->flags & SA_TIMER) && system_timer->dyn_tick != NULL) {
-               write_seqlock(&xtime_lock);
+               spin_lock(&system_timer->dyn_tick->lock);
                if (system_timer->dyn_tick->state & DYN_TICK_ENABLED)
                        system_timer->dyn_tick->handler(irq, 0, regs);
-               write_sequnlock(&xtime_lock);
+               spin_unlock(&system_timer->dyn_tick->lock);
        }
 #endif
 
@@ -684,8 +689,12 @@ int setup_irq(unsigned int irq, struct irqaction *new)
        spin_lock_irqsave(&irq_controller_lock, flags);
        p = &desc->action;
        if ((old = *p) != NULL) {
-               /* Can't share interrupts unless both agree to */
-               if (!(old->flags & new->flags & SA_SHIRQ)) {
+               /*
+                * Can't share interrupts unless both agree to and are
+                * the same type.
+                */
+               if (!(old->flags & new->flags & SA_SHIRQ) ||
+                   (~old->flags & new->flags) & SA_TRIGGER_MASK) {
                        spin_unlock_irqrestore(&irq_controller_lock, flags);
                        return -EBUSY;
                }
@@ -705,6 +714,13 @@ int setup_irq(unsigned int irq, struct irqaction *new)
                desc->running = 0;
                desc->pending = 0;
                desc->disable_depth = 1;
+
+               if (new->flags & SA_TRIGGER_MASK &&
+                   desc->chip->set_type) {
+                       unsigned int type = new->flags & SA_TRIGGER_MASK;
+                       desc->chip->set_type(irq, type);
+               }
+
                if (!desc->noautoenable) {
                        desc->disable_depth = 0;
                        desc->chip->unmask(irq);
@@ -1027,7 +1043,6 @@ void __init init_irq_proc(void)
 void __init init_IRQ(void)
 {
        struct irqdesc *desc;
-       extern void init_dma(void);
        int irq;
 
 #ifdef CONFIG_SMP
@@ -1041,7 +1056,6 @@ void __init init_IRQ(void)
        }
 
        init_arch_irq();
-       init_dma();
 }
 
 static int __init noirqdebug_setup(char *str)