Merge git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc
[sfrench/cifs-2.6.git] / arch / arm / kernel / irq.c
index d7099dbbb879ab8cd9ed6c417bdcc87d461dd747..2d5896b36181fa8ceb9636240b8abd13a2a0992e 100644 (file)
@@ -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);
@@ -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)