]> err.no Git - linux-2.6/commitdiff
[PATCH] genirq: add IRQ_NOAUTOEN support
authorThomas Gleixner <tglx@linutronix.de>
Thu, 29 Jun 2006 09:24:50 +0000 (02:24 -0700)
committerLinus Torvalds <torvalds@g5.osdl.org>
Thu, 29 Jun 2006 17:26:24 +0000 (10:26 -0700)
Enable platforms to disable the automatic enabling of freshly set up irqs.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
include/linux/irq.h
kernel/irq/handle.c
kernel/irq/manage.c

index 1df49ec7f8204b55912c703e224c7b3d31f623f8..14d7e94048dd0cdb4122b408576842e380425409 100644 (file)
@@ -42,6 +42,7 @@
 
 #define IRQ_NOPROBE    512     /* IRQ is not valid for probing */
 #define IRQ_NOREQUEST  1024    /* IRQ cannot be requested */
+#define IRQ_NOAUTOEN   2048    /* IRQ will not be enabled on request irq */
 /**
  * struct hw_interrupt_type - hardware interrupt type descriptor
  *
index 402fa3aec1e47b31c0a2c61e316b483271228dd0..9b398d52f1b79ccd01adac4ebe03176eb3723bfa 100644 (file)
@@ -32,6 +32,7 @@ struct irq_desc irq_desc[NR_IRQS] __cacheline_aligned = {
        [0 ... NR_IRQS-1] = {
                .status = IRQ_DISABLED,
                .chip = &no_irq_type,
+               .depth = 1,
                .lock = SPIN_LOCK_UNLOCKED,
 #ifdef CONFIG_SMP
                .affinity = CPU_MASK_ALL
index cae900a849c43867f3f3bb211e7c167a9baa1b45..9ea18879fb62bffa24cebe16b09bb9d52ad57e97 100644 (file)
@@ -216,13 +216,17 @@ int setup_irq(unsigned int irq, struct irqaction *new)
                desc->status |= IRQ_PER_CPU;
 #endif
        if (!shared) {
-               desc->depth = 0;
-               desc->status &= ~(IRQ_DISABLED | IRQ_AUTODETECT |
-                                 IRQ_WAITING | IRQ_INPROGRESS);
-               if (desc->chip->startup)
-                       desc->chip->startup(irq);
-               else
-                       desc->chip->enable(irq);
+               desc->status &= ~(IRQ_AUTODETECT | IRQ_WAITING |
+                                 IRQ_INPROGRESS);
+
+               if (!(desc->status & IRQ_NOAUTOEN)) {
+                       desc->depth = 0;
+                       desc->status &= ~IRQ_DISABLED;
+                       if (desc->chip->startup)
+                               desc->chip->startup(irq);
+                       else
+                               desc->chip->enable(irq);
+               }
        }
        spin_unlock_irqrestore(&desc->lock, flags);