Skip to contentSkip to conversation

genirq: add IRQ_NOREQUEST support

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

lore
Share & tools
lore
#0 lore raw

PATCH 18/50 genirq: add IRQ_NOREQUEST support

From: Thomas Gleixner <[email protected]>

enable platforms to disable request_irq() for certain interrupts.

---
 include/linux/irq.h |    1 +
 kernel/irq/manage.c |    4 +++-
 2 files changed, 4 insertions(+), 1 deletion(-)
include/linux/irq.h +1 -0
Index: linux-genirq.q/include/linux/irq.h
===================================================================
@@ -41,6 +41,7 @@
 #endif
 
 #define IRQ_NOPROBE	512	/* IRQ is not valid for probing */
+#define IRQ_NOREQUEST	1024	/* IRQ cannot be requested */
 /**
  * struct hw_interrupt_type - hardware interrupt type descriptor
  *
kernel/irq/manage.c +3 -1
Index: linux-genirq.q/kernel/irq/manage.c
===================================================================
@@ -141,7 +141,7 @@ int can_request_irq(unsigned int irq, un
 {
 	struct irqaction *action;
 
-	if (irq >= NR_IRQS)
+	if (irq >= NR_IRQS || irq_desc[irq].status & IRQ_NOREQUEST)
 		return 0;
 
 	action = irq_desc[irq].action;
@@ -356,6 +356,8 @@ int request_irq(unsigned int irq,
 		return -EINVAL;
 	if (irq >= NR_IRQS)
 		return -EINVAL;
+	if (irq_desc[irq].status & IRQ_NOREQUEST)
+		return -EINVAL;
 	if (!handler)
 		return -EINVAL;