Merge branch 'cpus4096' into irq/threaded
[safe/jmp/linux-2.6] / kernel / irq / autoprobe.c
index 0cbff18..1de9700 100644 (file)
@@ -10,6 +10,7 @@
 #include <linux/module.h>
 #include <linux/interrupt.h>
 #include <linux/delay.h>
+#include <linux/async.h>
 
 #include "internals.h"
 
@@ -34,6 +35,10 @@ unsigned long probe_irq_on(void)
        unsigned int status;
        int i;
 
+       /*
+        * quiesce the kernel, or at least the asynchronous portion
+        */
+       async_synchronize_full();
        mutex_lock(&probing_active);
        /*
         * something may have generated an irq long ago and we want to
@@ -161,7 +166,7 @@ EXPORT_SYMBOL(probe_irq_mask);
  */
 int probe_irq_off(unsigned long val)
 {
-       int i, irq_found = 0, nr_irqs = 0;
+       int i, irq_found = 0, nr_of_irqs = 0;
        struct irq_desc *desc;
        unsigned int status;
 
@@ -171,9 +176,9 @@ int probe_irq_off(unsigned long val)
 
                if (status & IRQ_AUTODETECT) {
                        if (!(status & IRQ_WAITING)) {
-                               if (!nr_irqs)
+                               if (!nr_of_irqs)
                                        irq_found = i;
-                               nr_irqs++;
+                               nr_of_irqs++;
                        }
                        desc->status = status & ~IRQ_AUTODETECT;
                        desc->chip->shutdown(i);
@@ -182,7 +187,7 @@ int probe_irq_off(unsigned long val)
        }
        mutex_unlock(&probing_active);
 
-       if (nr_irqs > 1)
+       if (nr_of_irqs > 1)
                irq_found = -irq_found;
 
        return irq_found;