[patch 17/50] genirq: add IRQ_NOPROBE support

From: Ingo Molnar
Date: Tue May 16 2006 - 20:28:54 EST


From: Thomas Gleixner <tglx@xxxxxxxxxxxxx>

introduce IRQ_NOPROBE: enables platforms to control chip-probing.

Signed-off-by: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
Signed-off-by: Ingo Molnar <mingo@xxxxxxx>
---
include/linux/irq.h | 1 +
kernel/irq/autoprobe.c | 4 ++--
kernel/irq/manage.c | 4 ++++
3 files changed, 7 insertions(+), 2 deletions(-)

Index: linux-genirq.q/include/linux/irq.h
===================================================================
--- linux-genirq.q.orig/include/linux/irq.h
+++ linux-genirq.q/include/linux/irq.h
@@ -40,6 +40,7 @@
# define CHECK_IRQ_PER_CPU(var) 0
#endif

+#define IRQ_NOPROBE 512 /* IRQ is not valid for probing */
/**
* struct hw_interrupt_type - hardware interrupt type descriptor
*
Index: linux-genirq.q/kernel/irq/autoprobe.c
===================================================================
--- linux-genirq.q.orig/kernel/irq/autoprobe.c
+++ linux-genirq.q/kernel/irq/autoprobe.c
@@ -40,7 +40,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->handler->startup(i);
spin_unlock_irq(&desc->lock);
}
@@ -57,7 +57,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->handler->startup(i))
desc->status |= IRQ_PENDING;
Index: linux-genirq.q/kernel/irq/manage.c
===================================================================
--- linux-genirq.q.orig/kernel/irq/manage.c
+++ linux-genirq.q/kernel/irq/manage.c
@@ -118,6 +118,10 @@ void enable_irq(unsigned int irq)
WARN_ON(1);
break;
case 1: {
+ unsigned int status = desc->status & ~IRQ_DISABLED;
+
+ /* Prevent probing on this irq: */
+ desc->status = status | IRQ_NOPROBE;
check_irq_resend(desc, irq);
/* fall-through */
}
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/