From: Thomas Gleixner Date: Thu, 29 Jun 2006 09:24:50 +0000 (-0700) Subject: [PATCH] genirq: add IRQ_NOAUTOEN support X-Git-Tag: v2.6.18-rc1~375 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=94d39e1f6e8132ea982a1d61acbe0423d3d14365;p=linux-2.6 [PATCH] genirq: add IRQ_NOAUTOEN support Enable platforms to disable the automatic enabling of freshly set up irqs. Signed-off-by: Thomas Gleixner Signed-off-by: Ingo Molnar Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/include/linux/irq.h b/include/linux/irq.h index 1df49ec7f8..14d7e94048 100644 --- a/include/linux/irq.h +++ b/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 * diff --git a/kernel/irq/handle.c b/kernel/irq/handle.c index 402fa3aec1..9b398d52f1 100644 --- a/kernel/irq/handle.c +++ b/kernel/irq/handle.c @@ -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 diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c index cae900a849..9ea18879fb 100644 --- a/kernel/irq/manage.c +++ b/kernel/irq/manage.c @@ -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);