]> git.karo-electronics.de Git - linux-beck.git/commitdiff
genirq: Move IRQ_MASKED to core
authorThomas Gleixner <tglx@linutronix.de>
Tue, 8 Feb 2011 11:36:06 +0000 (12:36 +0100)
committerThomas Gleixner <tglx@linutronix.de>
Sat, 19 Feb 2011 11:58:17 +0000 (12:58 +0100)
Keep status in sync until all users are fixed.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
include/linux/irq.h
kernel/irq/chip.c
kernel/irq/compat.h
kernel/irq/internals.h
kernel/irq/manage.c
kernel/irq/migration.c
kernel/irq/settings.h

index 7ca55c9deba4cd6d1d8ebd5070cd2e4d95076ca1..9800bac4c39855250e4927ee228fd4e3527ab272 100644 (file)
@@ -57,11 +57,11 @@ typedef     void (*irq_flow_handler_t)(unsigned int irq,
 #define IRQ_WAITING            0x00000400      /* DEPRECATED */
 #define IRQ_DISABLED           0x00000800      /* DEPRECATED */
 #define IRQ_PENDING            0x00001000      /* DEPRECATED */
+#define IRQ_MASKED             0x00002000      /* DEPRECATED */
 #endif
 
 
 #define IRQ_LEVEL              0x00004000      /* IRQ level triggered */
-#define IRQ_MASKED             0x00008000      /* IRQ masked - shouldn't be seen again */
 #define IRQ_PER_CPU            0x00010000      /* IRQ is per CPU */
 #define IRQ_NOPROBE            0x00020000      /* IRQ is not valid for probing */
 #define IRQ_NOREQUEST          0x00040000      /* IRQ cannot be requested */
index 17c87865bfb19040e4b01bec6df1509982f7ab3a..73b2e7e0093412ed740e4ed7d96982ba4978ff60 100644 (file)
@@ -176,6 +176,18 @@ static void irq_state_set_disabled(struct irq_desc *desc)
        irq_compat_set_disabled(desc);
 }
 
+static void irq_state_clr_masked(struct irq_desc *desc)
+{
+       desc->istate &= ~IRQS_MASKED;
+       irq_compat_clr_masked(desc);
+}
+
+static void irq_state_set_masked(struct irq_desc *desc)
+{
+       desc->istate |= IRQS_MASKED;
+       irq_compat_set_masked(desc);
+}
+
 int irq_startup(struct irq_desc *desc)
 {
        irq_state_clr_disabled(desc);
@@ -183,7 +195,7 @@ int irq_startup(struct irq_desc *desc)
 
        if (desc->irq_data.chip->irq_startup) {
                int ret = desc->irq_data.chip->irq_startup(&desc->irq_data);
-               desc->status &= ~IRQ_MASKED;
+               irq_state_clr_masked(desc);
                return ret;
        }
 
@@ -201,7 +213,7 @@ 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;
+       irq_state_set_masked(desc);
 }
 
 void irq_enable(struct irq_desc *desc)
@@ -211,7 +223,7 @@ void irq_enable(struct irq_desc *desc)
                desc->irq_data.chip->irq_enable(&desc->irq_data);
        else
                desc->irq_data.chip->irq_unmask(&desc->irq_data);
-       desc->status &= ~IRQ_MASKED;
+       irq_state_clr_masked(desc);
 }
 
 void irq_disable(struct irq_desc *desc)
@@ -219,8 +231,8 @@ void irq_disable(struct irq_desc *desc)
        irq_state_set_disabled(desc);
        if (desc->irq_data.chip->irq_disable) {
                desc->irq_data.chip->irq_disable(&desc->irq_data);
-               desc->status |= IRQ_MASKED;
        }
+       irq_state_set_masked(desc);
 }
 
 #ifndef CONFIG_GENERIC_HARDIRQS_NO_DEPRECATED
@@ -352,14 +364,14 @@ static inline void mask_ack_irq(struct irq_desc *desc)
                if (desc->irq_data.chip->irq_ack)
                        desc->irq_data.chip->irq_ack(&desc->irq_data);
        }
-       desc->status |= IRQ_MASKED;
+       irq_state_set_masked(desc);
 }
 
 static inline void mask_irq(struct irq_desc *desc)
 {
        if (desc->irq_data.chip->irq_mask) {
                desc->irq_data.chip->irq_mask(&desc->irq_data);
-               desc->status |= IRQ_MASKED;
+               irq_state_set_masked(desc);
        }
 }
 
@@ -367,7 +379,7 @@ static inline void unmask_irq(struct irq_desc *desc)
 {
        if (desc->irq_data.chip->irq_unmask) {
                desc->irq_data.chip->irq_unmask(&desc->irq_data);
-               desc->status &= ~IRQ_MASKED;
+               irq_state_clr_masked(desc);
        }
 }
 
@@ -583,7 +595,7 @@ handle_edge_irq(unsigned int irq, struct irq_desc *desc)
                 */
                if (unlikely(desc->istate & IRQS_PENDING)) {
                        if (!(desc->istate & IRQS_DISABLED) &&
-                           (desc->status & IRQ_MASKED))
+                           (desc->istate & IRQS_MASKED))
                                unmask_irq(desc);
                }
 
index 0067a69781f47bd1aafe19ac87787b37624491a6..593abecbcc4467f8860154a1fababce2dbe18043 100644 (file)
@@ -28,6 +28,15 @@ static inline void irq_compat_clr_pending(struct irq_desc *desc)
 {
        desc->status &= ~IRQ_PENDING;
 }
+static inline void irq_compat_set_masked(struct irq_desc *desc)
+{
+       desc->status |= IRQ_MASKED;
+}
+
+static inline void irq_compat_clr_masked(struct irq_desc *desc)
+{
+       desc->status &= ~IRQ_MASKED;
+}
 #else
 static inline void irq_compat_set_progress(struct irq_desc *desc) { }
 static inline void irq_compat_clr_progress(struct irq_desc *desc) { }
@@ -35,5 +44,7 @@ static inline void irq_compat_set_disabled(struct irq_desc *desc) { }
 static inline void irq_compat_clr_disabled(struct irq_desc *desc) { }
 static inline void irq_compat_set_pending(struct irq_desc *desc) { }
 static inline void irq_compat_clr_pending(struct irq_desc *desc) { }
+static inline void irq_compat_set_masked(struct irq_desc *desc) { }
+static inline void irq_compat_clr_masked(struct irq_desc *desc) { }
 #endif
 
index fdf2524437eb6fa9b646dd230c33e1a2cbd8e40b..3f2fcc194dcc4de51727d122edffff51e544e9d0 100644 (file)
@@ -47,6 +47,7 @@ enum {
  * IRQS_WAITING                        - irq is waiting
  * IRQS_DISABLED               - irq is disabled
  * IRQS_PENDING                        - irq is pending and replayed later
+ * IRQS_MASKED                 - irq is masked
  */
 enum {
        IRQS_AUTODETECT         = 0x00000001,
@@ -58,6 +59,7 @@ enum {
        IRQS_WAITING            = 0x00000080,
        IRQS_DISABLED           = 0x00000100,
        IRQS_PENDING            = 0x00000200,
+       IRQS_MASKED             = 0x00000400,
 };
 
 #define irq_data_to_desc(data) container_of(data, struct irq_desc, irq_data)
@@ -142,7 +144,6 @@ static inline void print_irq_desc(unsigned int irq, struct irq_desc *desc)
        }
 
        P(IRQ_LEVEL);
-       P(IRQ_MASKED);
 #ifdef CONFIG_IRQ_PER_CPU
        P(IRQ_PER_CPU);
 #endif
@@ -156,6 +157,7 @@ static inline void print_irq_desc(unsigned int irq, struct irq_desc *desc)
        PS(IRQS_WAITING);
        PS(IRQS_DISABLED);
        PS(IRQS_PENDING);
+       PS(IRQS_MASKED);
 }
 
 #undef P
index ac060814a787f9bc71bda582dbd2913b2d0e8e0e..83fd20194e5bdcda98e96e01385b07315e3f58f3 100644 (file)
@@ -646,8 +646,9 @@ again:
                goto again;
        }
 
-       if (!(desc->istate & IRQS_DISABLED) && (desc->status & IRQ_MASKED)) {
-               desc->status &= ~IRQ_MASKED;
+       if (!(desc->istate & IRQS_DISABLED) && (desc->istate & IRQS_MASKED)) {
+               irq_compat_clr_masked(desc);
+               desc->istate &= ~IRQS_MASKED;
                desc->irq_data.chip->irq_unmask(&desc->irq_data);
        }
        raw_spin_unlock_irq(&desc->lock);
index 8c68cb8555a762bcf35dc156b11df8088b8cdbae..6f2f98480354b2b8ef9550fe532e79e301a7eb23 100644 (file)
@@ -69,7 +69,7 @@ void move_native_irq(int irq)
         * threaded interrupt with ONESHOT set, we can end up with an
         * interrupt storm.
         */
-       masked = desc->status & IRQ_MASKED;
+       masked = desc->istate & IRQS_MASKED;
        if (!masked)
                desc->irq_data.chip->irq_mask(&desc->irq_data);
        move_masked_irq(irq);
index 623fcf83e7de1038e7fc1b971d471646a8cc74ed..2cd45fd5ec8a33d5e41070af6b5e48a0b0b8e77b 100644 (file)
@@ -16,3 +16,5 @@ enum {
 #define IRQ_DISABLED           GOT_YOU_MORON
 #undef IRQ_PENDING
 #define IRQ_PENDING            GOT_YOU_MORON
+#undef IRQ_MASKED
+#define IRQ_MASKED             GOT_YOU_MORON