]> git.karo-electronics.de Git - linux-beck.git/commitdiff
genirq: Consolidate IRQ_DISABLED
authorThomas Gleixner <tglx@linutronix.de>
Fri, 4 Feb 2011 09:17:52 +0000 (10:17 +0100)
committerThomas Gleixner <tglx@linutronix.de>
Sat, 19 Feb 2011 11:58:11 +0000 (12:58 +0100)
Handle IRQ_DISABLED consistent.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
kernel/irq/chip.c
kernel/irq/manage.c
kernel/irq/resend.c
kernel/irq/spurious.c

index 1a239a83f925cbaed7e16c7d100ac2740e428cc5..43c62ca68c11afd5b28244e087fcbbcf3c6fde1c 100644 (file)
@@ -194,11 +194,14 @@ EXPORT_SYMBOL_GPL(set_irq_nested_thread);
 
 int irq_startup(struct irq_desc *desc)
 {
-       desc->status &= ~(IRQ_MASKED | IRQ_DISABLED);
+       desc->status &= ~IRQ_DISABLED;
        desc->depth = 0;
 
-       if (desc->irq_data.chip->irq_startup)
-               return desc->irq_data.chip->irq_startup(&desc->irq_data);
+       if (desc->irq_data.chip->irq_startup) {
+               int ret = desc->irq_data.chip->irq_startup(&desc->irq_data);
+               desc->status &= ~IRQ_MASKED;
+               return ret;
+       }
 
        irq_enable(desc);
        return 0;
@@ -206,7 +209,7 @@ int irq_startup(struct irq_desc *desc)
 
 void irq_shutdown(struct irq_desc *desc)
 {
-       desc->status |= IRQ_MASKED | IRQ_DISABLED;
+       desc->status |= IRQ_DISABLED;
        desc->depth = 1;
        if (desc->irq_data.chip->irq_shutdown)
                desc->irq_data.chip->irq_shutdown(&desc->irq_data);
@@ -214,10 +217,12 @@ void irq_shutdown(struct irq_desc *desc)
                desc->irq_data.chip->irq_disable(&desc->irq_data);
        else
                desc->irq_data.chip->irq_mask(&desc->irq_data);
+       desc->status |= IRQ_MASKED;
 }
 
 void irq_enable(struct irq_desc *desc)
 {
+       desc->status &= ~IRQ_DISABLED;
        if (desc->irq_data.chip->irq_enable)
                desc->irq_data.chip->irq_enable(&desc->irq_data);
        else
@@ -227,6 +232,7 @@ void irq_enable(struct irq_desc *desc)
 
 void irq_disable(struct irq_desc *desc)
 {
+       desc->status |= IRQ_DISABLED;
        if (desc->irq_data.chip->irq_disable) {
                desc->irq_data.chip->irq_disable(&desc->irq_data);
                desc->status |= IRQ_MASKED;
index 2a6c6ee11a3fe3b1199f8089842a8cae373578be..78a566a9b39f77087cb7729f9ce651aeaad7532d 100644 (file)
@@ -329,10 +329,8 @@ void __disable_irq(struct irq_desc *desc, unsigned int irq, bool suspend)
                desc->status |= IRQ_SUSPENDED;
        }
 
-       if (!desc->depth++) {
-               desc->status |= IRQ_DISABLED;
+       if (!desc->depth++)
                irq_disable(desc);
-       }
 }
 
 /**
@@ -407,12 +405,11 @@ void __enable_irq(struct irq_desc *desc, unsigned int irq, bool resume)
                WARN(1, KERN_WARNING "Unbalanced enable for IRQ %d\n", irq);
                break;
        case 1: {
-               unsigned int status = desc->status & ~IRQ_DISABLED;
-
                if (desc->status & IRQ_SUSPENDED)
                        goto err_out;
                /* Prevent probing on this irq: */
-               desc->status = status | IRQ_NOPROBE;
+               desc->status |= IRQ_NOPROBE;
+               irq_enable(desc);
                check_irq_resend(desc, irq);
                /* fall-through */
        }
index 4bfe268dffe5fe4050b0210aa7fb6af1f5b81556..60b20261041b885980692a6a3eb3c5f4c2549608 100644 (file)
@@ -55,11 +55,6 @@ static DECLARE_TASKLET(resend_tasklet, resend_irqs, 0);
  */
 void check_irq_resend(struct irq_desc *desc, unsigned int irq)
 {
-       /*
-        * Make sure the interrupt is enabled, before resending it:
-        */
-       irq_enable(desc);
-
        /*
         * We do not resend level type interrupts. Level type
         * interrupts are resent by hardware when they are still
index c300b8f6008d7f05d3e840ce6e56970cf6e1dc92..89e5e16aca39a6ddcb06734f231a821955fd8efd 100644 (file)
@@ -301,7 +301,7 @@ void note_interrupt(unsigned int irq, struct irq_desc *desc,
                 * Now kill the IRQ
                 */
                printk(KERN_EMERG "Disabling IRQ #%d\n", irq);
-               desc->status |= IRQ_DISABLED | IRQ_SPURIOUS_DISABLED;
+               desc->status |= IRQ_SPURIOUS_DISABLED;
                desc->depth++;
                irq_disable(desc);