genirq: Call bus_lock/unlock functions in setup_irq()
authorDavid Daney <ddaney@caviumnetworks.com>
Thu, 10 Feb 2011 00:04:25 +0000 (16:04 -0800)
committerThomas Gleixner <tglx@linutronix.de>
Thu, 10 Feb 2011 23:25:13 +0000 (00:25 +0100)
irq_chips that supply .irq_bus_lock/.irq_bus_sync_unlock functions,
expect that the other chip methods will be called inside of calls to
the pair.  If this expectation is not met, things tend to not work.

Make setup_irq() call chip_bus_lock()/chip_bus_sync_unlock() too.

For the vast majority of irq_chips, this will be a NOP as most don't
have these bus lock functions.

[ tglx: No we don't want to call that in __setup_irq(). Way too many
   error exit pathes. ]

Signed-off-by: David Daney <ddaney@caviumnetworks.com>
LKML-Reference: <1297296265-18680-1-git-send-email-ddaney@caviumnetworks.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
kernel/irq/manage.c

index 0caa59f..a00bf2c 100644 (file)
@@ -871,9 +871,14 @@ out_thread:
  */
 int setup_irq(unsigned int irq, struct irqaction *act)
 {
+       int retval;
        struct irq_desc *desc = irq_to_desc(irq);
 
-       return __setup_irq(irq, desc, act);
+       chip_bus_lock(desc);
+       retval = __setup_irq(irq, desc, act);
+       chip_bus_sync_unlock(desc);
+
+       return retval;
 }
 EXPORT_SYMBOL_GPL(setup_irq);