]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - kernel/irq/autoprobe.c
module: remove CONFIG_KMOD in comment after #endif
[linux-2.6-omap-h63xx.git] / kernel / irq / autoprobe.c
index d6eab98a3173ad2cfd04868d7fd56ff509939a67..533068cfb607fad10202210b916909efd314cbb7 100644 (file)
@@ -11,6 +11,8 @@
 #include <linux/interrupt.h>
 #include <linux/delay.h>
 
+#include "internals.h"
+
 /*
  * Autodetection depends on the fact that any interrupt that
  * comes in on to an unassigned handler will get stuck with
@@ -27,8 +29,8 @@ static DEFINE_MUTEX(probing_active);
  */
 unsigned long probe_irq_on(void)
 {
+       struct irq_desc *desc;
        unsigned long mask;
-       irq_desc_t *desc;
        unsigned int i;
 
        mutex_lock(&probing_active);
@@ -40,8 +42,21 @@ unsigned long probe_irq_on(void)
                desc = irq_desc + i;
 
                spin_lock_irq(&desc->lock);
-               if (!desc->action)
+               if (!desc->action && !(desc->status & IRQ_NOPROBE)) {
+                       /*
+                        * An old-style architecture might still have
+                        * the handle_bad_irq handler there:
+                        */
+                       compat_irq_chip_set_default_handler(desc);
+
+                       /*
+                        * Some chips need to know about probing in
+                        * progress:
+                        */
+                       if (desc->chip->set_type)
+                               desc->chip->set_type(i, IRQ_TYPE_PROBE);
                        desc->chip->startup(i);
+               }
                spin_unlock_irq(&desc->lock);
        }
 
@@ -57,7 +72,7 @@ unsigned long probe_irq_on(void)
                desc = irq_desc + i;
 
                spin_lock_irq(&desc->lock);
-               if (!desc->action) {
+               if (!desc->action && !(desc->status & IRQ_NOPROBE)) {
                        desc->status |= IRQ_AUTODETECT | IRQ_WAITING;
                        if (desc->chip->startup(i))
                                desc->status |= IRQ_PENDING;
@@ -116,7 +131,7 @@ unsigned int probe_irq_mask(unsigned long val)
 
        mask = 0;
        for (i = 0; i < NR_IRQS; i++) {
-               irq_desc_t *desc = irq_desc + i;
+               struct irq_desc *desc = irq_desc + i;
                unsigned int status;
 
                spin_lock_irq(&desc->lock);
@@ -159,7 +174,7 @@ int probe_irq_off(unsigned long val)
        int i, irq_found = 0, nr_irqs = 0;
 
        for (i = 0; i < NR_IRQS; i++) {
-               irq_desc_t *desc = irq_desc + i;
+               struct irq_desc *desc = irq_desc + i;
                unsigned int status;
 
                spin_lock_irq(&desc->lock);