]> git.karo-electronics.de Git - linux-beck.git/commitdiff
genirq: Move IRQ_PENDING flag to core
authorThomas Gleixner <tglx@linutronix.de>
Tue, 8 Feb 2011 11:17:57 +0000 (12:17 +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/autoprobe.c
kernel/irq/chip.c
kernel/irq/compat.h
kernel/irq/handle.c
kernel/irq/internals.h
kernel/irq/manage.c
kernel/irq/pm.c
kernel/irq/resend.c
kernel/irq/settings.h
kernel/irq/spurious.c

index 32efca71ce8881d26de0ab817acfc9d25e487ef0..7ca55c9deba4cd6d1d8ebd5070cd2e4d95076ca1 100644 (file)
@@ -56,9 +56,9 @@ typedef       void (*irq_flow_handler_t)(unsigned int irq,
 #define IRQ_REPLAY             0x00000200      /* DEPRECATED */
 #define IRQ_WAITING            0x00000400      /* DEPRECATED */
 #define IRQ_DISABLED           0x00000800      /* DEPRECATED */
+#define IRQ_PENDING            0x00001000      /* DEPRECATED */
 #endif
 
-#define IRQ_PENDING            0x00001000      /* IRQ pending - replay on enable */
 
 #define IRQ_LEVEL              0x00004000      /* IRQ level triggered */
 #define IRQ_MASKED             0x00008000      /* IRQ masked - shouldn't be seen again */
index 9ea8bb99f7c1f3b6881fbe64babb9462d07c49f2..aab64c2627266214bde46c4ee50b8321d3a611d6 100644 (file)
@@ -76,8 +76,10 @@ unsigned long probe_irq_on(void)
                raw_spin_lock_irq(&desc->lock);
                if (!desc->action && !(desc->status & IRQ_NOPROBE)) {
                        desc->istate |= IRQS_AUTODETECT | IRQS_WAITING;
-                       if (irq_startup(desc))
-                               desc->status |= IRQ_PENDING;
+                       if (irq_startup(desc)) {
+                               irq_compat_set_pending(desc);
+                               desc->istate |= IRQS_PENDING;
+                       }
                }
                raw_spin_unlock_irq(&desc->lock);
        }
index 527df7ab1b054b429763e9438b8078c146575431..17c87865bfb19040e4b01bec6df1509982f7ab3a 100644 (file)
@@ -518,7 +518,8 @@ handle_fasteoi_irq(unsigned int irq, struct irq_desc *desc)
         * then mask it and get out of here:
         */
        if (unlikely(!desc->action || (desc->istate & IRQS_DISABLED))) {
-               desc->status |= IRQ_PENDING;
+               irq_compat_set_pending(desc);
+               desc->istate |= IRQS_PENDING;
                mask_irq(desc);
                goto out;
        }
@@ -558,7 +559,8 @@ handle_edge_irq(unsigned int irq, struct irq_desc *desc)
        if (unlikely((desc->istate & (IRQS_DISABLED | IRQS_INPROGRESS) ||
                      !desc->action))) {
                if (!irq_check_poll(desc)) {
-                       desc->status |= IRQ_PENDING;
+                       irq_compat_set_pending(desc);
+                       desc->istate |= IRQS_PENDING;
                        mask_ack_irq(desc);
                        goto out_unlock;
                }
@@ -579,7 +581,7 @@ handle_edge_irq(unsigned int irq, struct irq_desc *desc)
                 * one, we could have masked the irq.
                 * Renable it, if it was not disabled in meantime.
                 */
-               if (unlikely(desc->status & IRQ_PENDING)) {
+               if (unlikely(desc->istate & IRQS_PENDING)) {
                        if (!(desc->istate & IRQS_DISABLED) &&
                            (desc->status & IRQ_MASKED))
                                unmask_irq(desc);
@@ -587,7 +589,7 @@ handle_edge_irq(unsigned int irq, struct irq_desc *desc)
 
                handle_irq_event(desc);
 
-       } while ((desc->status & IRQ_PENDING) &&
+       } while ((desc->istate & IRQS_PENDING) &&
                 !(desc->istate & IRQS_DISABLED));
 
 out_unlock:
index bc0c2a501e822be6d12070e71462ccc2887fe246..0067a69781f47bd1aafe19ac87787b37624491a6 100644 (file)
@@ -15,15 +15,25 @@ static inline void irq_compat_set_disabled(struct irq_desc *desc)
 {
        desc->status |= IRQ_DISABLED;
 }
-
 static inline void irq_compat_clr_disabled(struct irq_desc *desc)
 {
        desc->status &= ~IRQ_DISABLED;
 }
+static inline void irq_compat_set_pending(struct irq_desc *desc)
+{
+       desc->status |= IRQ_PENDING;
+}
+
+static inline void irq_compat_clr_pending(struct irq_desc *desc)
+{
+       desc->status &= ~IRQ_PENDING;
+}
 #else
 static inline void irq_compat_set_progress(struct irq_desc *desc) { }
 static inline void irq_compat_clr_progress(struct irq_desc *desc) { }
 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) { }
 #endif
 
index d4ae0b1ccc00f0fb2bf7af1551f9c475104c3da4..6e34bdbeb26a48e9918d60f10bbd35b07420bbf4 100644 (file)
@@ -122,7 +122,8 @@ irqreturn_t handle_irq_event(struct irq_desc *desc)
        struct irqaction *action = desc->action;
        irqreturn_t ret;
 
-       desc->status &= ~IRQ_PENDING;
+       irq_compat_clr_pending(desc);
+       desc->istate &= ~IRQS_PENDING;
        irq_compat_set_progress(desc);
        desc->istate |= IRQS_INPROGRESS;
        raw_spin_unlock(&desc->lock);
index 919d2dd0bb33a8f02a27e6e005e2c55137cad42d..fdf2524437eb6fa9b646dd230c33e1a2cbd8e40b 100644 (file)
@@ -46,6 +46,7 @@ enum {
  * IRQS_REPLAY                 - irq is replayed
  * IRQS_WAITING                        - irq is waiting
  * IRQS_DISABLED               - irq is disabled
+ * IRQS_PENDING                        - irq is pending and replayed later
  */
 enum {
        IRQS_AUTODETECT         = 0x00000001,
@@ -56,6 +57,7 @@ enum {
        IRQS_REPLAY             = 0x00000040,
        IRQS_WAITING            = 0x00000080,
        IRQS_DISABLED           = 0x00000100,
+       IRQS_PENDING            = 0x00000200,
 };
 
 #define irq_data_to_desc(data) container_of(data, struct irq_desc, irq_data)
@@ -139,7 +141,6 @@ static inline void print_irq_desc(unsigned int irq, struct irq_desc *desc)
                print_symbol("%s\n", (unsigned long)desc->action->handler);
        }
 
-       P(IRQ_PENDING);
        P(IRQ_LEVEL);
        P(IRQ_MASKED);
 #ifdef CONFIG_IRQ_PER_CPU
@@ -154,6 +155,7 @@ static inline void print_irq_desc(unsigned int irq, struct irq_desc *desc)
        PS(IRQS_REPLAY);
        PS(IRQS_WAITING);
        PS(IRQS_DISABLED);
+       PS(IRQS_PENDING);
 }
 
 #undef P
index 77ff275b54cf6a264e896282afdcd75de467c778..ac060814a787f9bc71bda582dbd2913b2d0e8e0e 100644 (file)
@@ -714,10 +714,11 @@ static int irq_thread(void *data)
                         * CHECKME: We might need a dedicated
                         * IRQ_THREAD_PENDING flag here, which
                         * retriggers the thread in check_irq_resend()
-                        * but AFAICT IRQ_PENDING should be fine as it
+                        * but AFAICT IRQS_PENDING should be fine as it
                         * retriggers the interrupt itself --- tglx
                         */
-                       desc->status |= IRQ_PENDING;
+                       irq_compat_set_pending(desc);
+                       desc->istate |= IRQS_PENDING;
                        raw_spin_unlock_irq(&desc->lock);
                } else {
                        raw_spin_unlock_irq(&desc->lock);
index d6bfb89cce910de5262617ff4e42fe353c258a0e..d7389418e91ac8fbc600e38060050fe70f64b1bc 100644 (file)
@@ -69,7 +69,8 @@ int check_wakeup_irqs(void)
        int irq;
 
        for_each_irq_desc(irq, desc)
-               if ((desc->status & IRQ_WAKEUP) && (desc->status & IRQ_PENDING))
+               if ((desc->status & IRQ_WAKEUP) &&
+                   (desc->istate & IRQS_PENDING))
                        return -EBUSY;
 
        return 0;
index f83387cd11f3b3ed702e970901bb82501f2eaaa5..ff1fea0600144051862bbdbd14e4b0a2270daeff 100644 (file)
@@ -64,8 +64,9 @@ void check_irq_resend(struct irq_desc *desc, unsigned int irq)
                return;
        if (desc->istate & IRQS_REPLAY)
                return;
-       if (desc->status & IRQ_PENDING) {
-               desc->status &= ~IRQ_PENDING;
+       if (desc->istate & IRQS_PENDING) {
+               irq_compat_clr_pending(desc);
+               desc->istate &= ~IRQS_PENDING;
                desc->istate |= IRQS_REPLAY;
 
                if (!desc->irq_data.chip->irq_retrigger ||
index 5e3411c7c62b29d9b2c28a80cf56f6fb76039326..623fcf83e7de1038e7fc1b971d471646a8cc74ed 100644 (file)
@@ -14,3 +14,5 @@ enum {
 #define IRQ_WAITING            GOT_YOU_MORON
 #undef IRQ_DISABLED
 #define IRQ_DISABLED           GOT_YOU_MORON
+#undef IRQ_PENDING
+#define IRQ_PENDING            GOT_YOU_MORON
index 367614f858ffc5fcfe2a7f52d6c7aa9d2d624a07..692ce2bae302080a9ae1512039c1208f6c30b3c0 100644 (file)
@@ -93,7 +93,8 @@ static int try_one_irq(int irq, struct irq_desc *desc, bool force)
                 * Already running: If it is shared get the other
                 * CPU to go looking for our mystery interrupt too
                 */
-               desc->status |= IRQ_PENDING;
+               irq_compat_set_pending(desc);
+               desc->istate |= IRQS_PENDING;
                goto out;
        }
 
@@ -103,7 +104,7 @@ static int try_one_irq(int irq, struct irq_desc *desc, bool force)
                if (handle_irq_event(desc) == IRQ_HANDLED)
                        ret = IRQ_HANDLED;
                action = desc->action;
-       } while ((desc->status & IRQ_PENDING) && action);
+       } while ((desc->istate & IRQS_PENDING) && action);
        desc->istate &= ~IRQS_POLL_INPROGRESS;
 out:
        raw_spin_unlock(&desc->lock);