]> git.karo-electronics.de Git - linux-beck.git/commitdiff
genirq: Provide default irq init flags
authorThomas Gleixner <tglx@linutronix.de>
Mon, 27 Sep 2010 19:01:37 +0000 (21:01 +0200)
committerThomas Gleixner <tglx@linutronix.de>
Tue, 12 Oct 2010 14:39:06 +0000 (16:39 +0200)
Arch code sets it's own irq_desc.status flags right after boot and for
dynamically allocated interrupts. That might involve iterating over a
huge array.

Allow ARCH_IRQ_INIT_FLAGS to set separate flags aside of IRQ_DISABLED
which is the default.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Ingo Molnar <mingo@elte.hu>
include/linux/irq.h
kernel/irq/chip.c
kernel/irq/irqdesc.c

index bea40556c5a66db90ea409374f40bc6349095a77..30a300991ed4de131677e5ade19f85501c4aebaa 100644 (file)
@@ -214,6 +214,12 @@ struct irq_chip {
  */
 #include <asm/hw_irq.h>
 
+#ifndef ARCH_IRQ_INIT_FLAGS
+# define ARCH_IRQ_INIT_FLAGS   0
+#endif
+
+#define IRQ_DEFAULT_INIT_FLAGS (IRQ_DISABLED | ARCH_IRQ_INIT_FLAGS)
+
 struct irqaction;
 extern int setup_irq(unsigned int irq, struct irqaction *new);
 extern void remove_irq(unsigned int irq, struct irqaction *act);
index 659be326c8e8fa0f87a020d604efb06578528844..3405761d6224a59f9a98951fb7d831379c39f658 100644 (file)
@@ -31,7 +31,7 @@ static void dynamic_irq_init_x(unsigned int irq, bool keep_chip_data)
 
        /* Ensure we don't have left over values from a previous use of this irq */
        raw_spin_lock_irqsave(&desc->lock, flags);
-       desc->status = IRQ_DISABLED;
+       desc->status = IRQ_DEFAULT_INIT_FLAGS;
        desc->irq_data.chip = &no_irq_chip;
        desc->handle_irq = handle_bad_irq;
        desc->depth = 1;
index 78ff426a6cb7f148f5b1cc242fdb4b9768a76ae4..29963f99f24d7330d8b2d2b8a482588da21fe8ca 100644 (file)
@@ -39,7 +39,7 @@ EXPORT_SYMBOL_GPL(nr_irqs);
 #ifdef CONFIG_SPARSE_IRQ
 
 static struct irq_desc irq_desc_init = {
-       .status         = IRQ_DISABLED,
+       .status         = IRQ_DEFAULT_INIT_FLAGS,
        .handle_irq     = handle_bad_irq,
        .depth          = 1,
        .lock           = __RAW_SPIN_LOCK_UNLOCKED(irq_desc_init.lock),
@@ -113,7 +113,7 @@ void replace_irq_desc(unsigned int irq, struct irq_desc *desc)
 
 static struct irq_desc irq_desc_legacy[NR_IRQS_LEGACY] __cacheline_aligned_in_smp = {
        [0 ... NR_IRQS_LEGACY-1] = {
-               .status         = IRQ_DISABLED,
+               .status         = IRQ_DEFAULT_INIT_FLAGS,
                .handle_irq     = handle_bad_irq,
                .depth          = 1,
                .lock           = __RAW_SPIN_LOCK_UNLOCKED(irq_desc_init.lock),
@@ -204,7 +204,7 @@ out_unlock:
 
 struct irq_desc irq_desc[NR_IRQS] __cacheline_aligned_in_smp = {
        [0 ... NR_IRQS-1] = {
-               .status         = IRQ_DISABLED,
+               .status         = IRQ_DEFAULT_INIT_FLAGS,
                .handle_irq     = handle_bad_irq,
                .depth          = 1,
                .lock           = __RAW_SPIN_LOCK_UNLOCKED(irq_desc->lock),