Skip to contentSkip to conversation

genirq: add IRQ_NOAUTOEN support

PATCH In review Ingo Molnar 1 participant 1 message May 17, 2006 IRQ

lore
Share & tools
lore
#0 lore raw

PATCH 19/50 genirq: add IRQ_NOAUTOEN support

From: Thomas Gleixner <[email protected]>

enable platforms to disable the automatic enabling of freshly set up irqs.

---
 include/linux/irq.h |    1 +
 kernel/irq/manage.c |   18 +++++++++++-------
 2 files changed, 12 insertions(+), 7 deletions(-)
include/linux/irq.h +1 -0
Index: linux-genirq.q/include/linux/irq.h
===================================================================
@@ -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
  *
kernel/irq/manage.c +11 -7
Index: linux-genirq.q/kernel/irq/manage.c
===================================================================
@@ -216,13 +216,17 @@ int setup_irq(unsigned int irq, struct i
 		desc->status |= IRQ_PER_CPU;
 #endif
 	if (!shared) {
-		desc->depth = 0;
-		desc->status &= ~(IRQ_DISABLED | IRQ_AUTODETECT |
-				  IRQ_WAITING | IRQ_INPROGRESS);
-		if (desc->handler->startup)
-			desc->handler->startup(irq);
-		else
-			desc->handler->enable(irq);
+		desc->status &= ~(IRQ_AUTODETECT | IRQ_WAITING |
+				  IRQ_INPROGRESS);
+
+		if (!(desc->status & IRQ_NOAUTOEN)) {
+			desc->depth = 0;
+			desc->status &= ~IRQ_DISABLED;
+			if (desc->handler->startup)
+				desc->handler->startup(irq);
+			else
+				desc->handler->enable(irq);
+		}
 	}
 	spin_unlock_irqrestore(&desc->lock, flags);