genirq: add IRQ_NOAUTOEN support
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.
Signed-off-by Thomas Gleixner <[email protected]>
Signed-off-by Ingo Molnar <[email protected]>
--- include/linux/irq.h | 1 + kernel/irq/manage.c | 18 +++++++++++------- 2 files changed, 12 insertions(+), 7 deletions(-)
include/linux/irq.h +1 -0
@@ -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
@@ -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);