All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@linutronix.de>
To: LKML <linux-kernel@vger.kernel.org>
Cc: Ingo Molnar <mingo@elte.hu>, Peter Zijlstra <peterz@infradead.org>
Subject: [patch 44/75] genirq: Move IRQ_PENDING flag to core
Date: Thu, 10 Feb 2011 23:37:32 -0000	[thread overview]
Message-ID: <20110210223258.556677117@linutronix.de> (raw)
In-Reply-To: 20110210222908.661199947@linutronix.de

[-- Attachment #1: genirq-move-pending.patch --]
[-- Type: text/plain, Size: 8777 bytes --]

Keep status in sync until all users are fixed.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
 include/linux/irq.h    |    2 +-
 kernel/irq/autoprobe.c |    6 ++++--
 kernel/irq/chip.c      |   10 ++++++----
 kernel/irq/compat.h    |   12 +++++++++++-
 kernel/irq/handle.c    |    3 ++-
 kernel/irq/internals.h |    4 +++-
 kernel/irq/manage.c    |    5 +++--
 kernel/irq/pm.c        |    3 ++-
 kernel/irq/resend.c    |    5 +++--
 kernel/irq/settings.h  |    2 ++
 kernel/irq/spurious.c  |    5 +++--
 11 files changed, 40 insertions(+), 17 deletions(-)

Index: linux-2.6-tip/include/linux/irq.h
===================================================================
--- linux-2.6-tip.orig/include/linux/irq.h
+++ linux-2.6-tip/include/linux/irq.h
@@ -56,9 +56,9 @@ typedef	void (*irq_flow_handler_t)(unsig
 #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: linux-2.6-tip/kernel/irq/autoprobe.c
===================================================================
--- linux-2.6-tip.orig/kernel/irq/autoprobe.c
+++ linux-2.6-tip/kernel/irq/autoprobe.c
@@ -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: linux-2.6-tip/kernel/irq/chip.c
===================================================================
--- linux-2.6-tip.orig/kernel/irq/chip.c
+++ linux-2.6-tip/kernel/irq/chip.c
@@ -544,7 +544,8 @@ handle_fasteoi_irq(unsigned int irq, str
 	 * 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;
 	}
@@ -584,7 +585,8 @@ handle_edge_irq(unsigned int irq, struct
 	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;
 		}
@@ -605,7 +607,7 @@ handle_edge_irq(unsigned int irq, struct
 		 * 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);
@@ -613,7 +615,7 @@ handle_edge_irq(unsigned int irq, struct
 
 		handle_irq_event(desc);
 
-	} while ((desc->status & IRQ_PENDING) &&
+	} while ((desc->istate & IRQS_PENDING) &&
 		 !(desc->istate & IRQS_DISABLED));
 
 out_unlock:
Index: linux-2.6-tip/kernel/irq/compat.h
===================================================================
--- linux-2.6-tip.orig/kernel/irq/compat.h
+++ linux-2.6-tip/kernel/irq/compat.h
@@ -15,15 +15,25 @@ static inline void irq_compat_set_disabl
 {
 	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: linux-2.6-tip/kernel/irq/handle.c
===================================================================
--- linux-2.6-tip.orig/kernel/irq/handle.c
+++ linux-2.6-tip/kernel/irq/handle.c
@@ -122,7 +122,8 @@ irqreturn_t handle_irq_event(struct irq_
 	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: linux-2.6-tip/kernel/irq/internals.h
===================================================================
--- linux-2.6-tip.orig/kernel/irq/internals.h
+++ linux-2.6-tip/kernel/irq/internals.h
@@ -42,6 +42,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,
@@ -53,6 +54,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)
@@ -137,7 +139,6 @@ static inline void print_irq_desc(unsign
 		print_symbol("%s\n", (unsigned long)desc->action->handler);
 	}
 
-	P(IRQ_PENDING);
 	P(IRQ_LEVEL);
 	P(IRQ_MASKED);
 #ifdef CONFIG_IRQ_PER_CPU
@@ -152,6 +153,7 @@ static inline void print_irq_desc(unsign
 	PS(IRQS_REPLAY);
 	PS(IRQS_WAITING);
 	PS(IRQS_DISABLED);
+	PS(IRQS_PENDING);
 }
 
 #undef P
Index: linux-2.6-tip/kernel/irq/manage.c
===================================================================
--- linux-2.6-tip.orig/kernel/irq/manage.c
+++ linux-2.6-tip/kernel/irq/manage.c
@@ -720,10 +720,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: linux-2.6-tip/kernel/irq/pm.c
===================================================================
--- linux-2.6-tip.orig/kernel/irq/pm.c
+++ linux-2.6-tip/kernel/irq/pm.c
@@ -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: linux-2.6-tip/kernel/irq/resend.c
===================================================================
--- linux-2.6-tip.orig/kernel/irq/resend.c
+++ linux-2.6-tip/kernel/irq/resend.c
@@ -64,8 +64,9 @@ void check_irq_resend(struct irq_desc *d
 		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: linux-2.6-tip/kernel/irq/settings.h
===================================================================
--- linux-2.6-tip.orig/kernel/irq/settings.h
+++ linux-2.6-tip/kernel/irq/settings.h
@@ -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: linux-2.6-tip/kernel/irq/spurious.c
===================================================================
--- linux-2.6-tip.orig/kernel/irq/spurious.c
+++ linux-2.6-tip/kernel/irq/spurious.c
@@ -93,7 +93,8 @@ static int try_one_irq(int irq, struct i
 		 * 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 i
 		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);



  parent reply	other threads:[~2011-02-10 23:37 UTC|newest]

Thread overview: 100+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-10 23:35 [patch 00/75] genirq: Overhaul for 2.6.39 Thomas Gleixner
2011-02-10 23:35 ` [patch 01/75] genirq: Namespace cleanup Thomas Gleixner
2011-02-10 23:35 ` [patch 02/75] genirq: Simplify affinity related code Thomas Gleixner
2011-02-10 23:35 ` [patch 03/75] genirq: Rremove redundant check Thomas Gleixner
2011-02-10 23:35 ` [patch 04/75] genirq: Always apply cpu online mask Thomas Gleixner
2011-02-10 23:36 ` [patch 05/75] genirq: Do not copy affinity before set Thomas Gleixner
2011-02-10 23:36 ` [patch 06/75] genirq: Plug race in report_bad_irq() Thomas Gleixner
2011-02-10 23:36 ` [patch 07/75] genirq: Warn when handler enables interrupts Thomas Gleixner
2011-02-10 23:36 ` [patch 08/75] genirq: Fixup poll handling Thomas Gleixner
2011-02-10 23:36 ` [patch 09/75] genirq: Do not poll disabled, percpu and timer interrupts Thomas Gleixner
2011-02-10 23:36 ` [patch 10/75] genirq: spurious: Run only one poller at a time Thomas Gleixner
2011-02-10 23:36 ` [patch 11/75] genirq: Mark polled irqs and defer the real handler Thomas Gleixner
2011-02-10 23:36 ` [patch 12/75] genirq: Move irq thread flags to core Thomas Gleixner
2011-02-10 23:36 ` [patch 13/75] genirq: Remove bogus conditional Thomas Gleixner
2011-02-10 23:36 ` [patch 14/75] genirq: Consolidate startup/shutdown of interrupts Thomas Gleixner
2011-02-10 23:36 ` [patch 15/75] genirq: Consolidate disable/enable Thomas Gleixner
2011-02-10 23:36 ` [patch 16/75] genirq: Remove default magic Thomas Gleixner
2011-02-10 23:36 ` [patch 17/75] genirq: Consolidate IRQ_DISABLED Thomas Gleixner
2011-02-11  7:57   ` Lars-Peter Clausen
2011-02-11 11:39     ` Thomas Gleixner
2011-02-10 23:36 ` [patch 18/75] genirq: Do not fiddle with IRQ_MASKED in handle_edge_irq() Thomas Gleixner
2011-02-10 23:36 ` [patch 19/75] m68knommu: 5772: Replace private irq flow handler Thomas Gleixner
2011-02-10 23:36 ` [patch 20/75] arm: Ns9xxx: Remove " Thomas Gleixner
2011-02-10 23:36   ` Thomas Gleixner
2011-02-10 23:36 ` [patch 21/75] genirq: Mark handle_IRQ_event deprecated Thomas Gleixner
2011-02-10 23:36 ` [patch 22/75] genirq: Implement handle_irq_event() Thomas Gleixner
2011-02-10 23:36 ` [patch 23/75] genirq: Use handle_irq_event() in handle_simple_irq() Thomas Gleixner
2011-02-10 23:36 ` [patch 24/75] genirq: Use handle_irq_event() in handle_level_irq() Thomas Gleixner
2011-02-10 23:36 ` [patch 25/75] genirq: Use handle_irq_event() in handle_fasteoi_irq() Thomas Gleixner
2011-02-10 23:36 ` [patch 26/75] genirq: Use handle_irq_event() in handle_edge_irq() Thomas Gleixner
2011-02-10 23:36 ` [patch 27/75] genirq: Use handle_perpcu_event() in handle_percpu_irq() Thomas Gleixner
2011-02-10 23:36 ` [patch 28/75] genirq: Use handle_irq_event() in the spurious poll code Thomas Gleixner
2011-02-10 23:36 ` [patch 29/75] genirq: Simplify handle_irq_event() Thomas Gleixner
2011-02-10 23:36 ` [patch 30/75] genirq: Implement generic irq_show_interrupts() Thomas Gleixner
2011-02-10 23:37 ` [patch 31/75] genirq: Fixup core code namespace fallout Thomas Gleixner
2011-02-10 23:37 ` [patch 32/75] genirq: Add internal state field to irq_desc Thomas Gleixner
2011-02-10 23:37 ` [patch 33/75] gpio: Remove broken irq_desc hackery Thomas Gleixner
2011-02-11 12:57   ` Wolfram Sang
2011-02-10 23:37 ` [patch 34/75] arm: ep93xx: Kill another instance of broken irq_desc fiddling Thomas Gleixner
2011-02-11  0:07   ` H Hartley Sweeten
2011-02-11  0:22   ` Ryan Mallon
2011-02-11 11:42     ` Thomas Gleixner
2011-02-11 20:16       ` Ryan Mallon
2011-02-10 23:37 ` [patch 35/75] genirq: Protect tglx from tripping over his own feet Thomas Gleixner
2011-02-10 23:37 ` [patch 36/75] genirq: Move IRQ_AUTODETECT to internal state Thomas Gleixner
2011-02-10 23:37 ` [patch 37/75] genirq: Move IRQ_SPURIOUS_DISABLED to core state Thomas Gleixner
2011-02-10 23:37 ` [patch 38/75] genirq: Move IRQ_NESTED_THREAD " Thomas Gleixner
2011-02-10 23:37 ` [patch 39/75] genirq: Move IRQ_POLL_INPROGRESS to core Thomas Gleixner
2011-02-10 23:37 ` [patch 40/75] genirq: Add IRQ_INPROGRESS " Thomas Gleixner
2011-02-10 23:37 ` [patch 41/75] genirq: Move IRQ_ONESHOT " Thomas Gleixner
2011-02-10 23:37 ` [patch 42/75] genirq: Move IRQ_REPLAY and IRQ_WAITING " Thomas Gleixner
2011-02-10 23:37 ` [patch 43/75] genirq: Move IRQ_DISABLED " Thomas Gleixner
2011-02-10 23:37 ` Thomas Gleixner [this message]
2011-02-10 23:37 ` [patch 45/75] genirq: Move IRQ_MASKED " Thomas Gleixner
2011-02-10 23:37 ` [patch 46/75] genirq: Move IRQ_SUSPENDED " Thomas Gleixner
2011-02-10 23:37 ` [patch 47/75] arm: tegra: Remove unused function which fiddles with irq_desc Thomas Gleixner
2011-02-10 23:37   ` Thomas Gleixner
2011-02-10 23:37   ` Thomas Gleixner
2011-02-10 23:48   ` Colin Cross
2011-02-10 23:48     ` Colin Cross
2011-02-10 23:37 ` [patch 48/75] genirq: Move IRQ_WAKEUP to core Thomas Gleixner
2011-02-10 23:37 ` [patch 49/75] genirq: Add state field to irq_data Thomas Gleixner
2011-02-10 23:37 ` [patch 50/75] genirq: Add IRQ_MOVE_PENDING to irq_data.state Thomas Gleixner
2011-02-10 23:37 ` [patch 51/75] genirq: Remove CONFIG_IRQ_PER_CPU Thomas Gleixner
2011-02-10 23:37 ` [patch 52/75] genirq: Make CHECK_IRQ_PER_CPU an inline and deprecate it Thomas Gleixner
2011-02-10 23:37 ` [patch 53/75] genirq: Remove CHECK_IRQ_PER_CPU from core code Thomas Gleixner
2011-02-10 23:37 ` [patch 54/75] genirq: Move debug code to separate header Thomas Gleixner
2011-02-10 23:37 ` [patch 55/75] genirq: Mirror IRQ_PER_CPU and IRQ_NO_BALANCING in irq_data.state Thomas Gleixner
2011-02-10 23:38 ` [patch 56/75] genirq: Reuse existing can set affinty check Thomas Gleixner
2011-02-10 23:38 ` [patch 57/75] genirq: Move IRQ_AFFINITY_SET to core Thomas Gleixner
2011-02-10 23:38 ` [patch 58/75] genirq: Mirror irq trigger type bits in irq_data.state Thomas Gleixner
2011-02-10 23:38 ` [patch 59/75] genirq: Wrap the remaning IRQ_* flags Thomas Gleixner
2011-02-10 23:38 ` [patch 60/75] genirq: Force wrapped access to desc->status in core code Thomas Gleixner
2011-02-10 23:38 ` [patch 61/75] genirq: Cleanup irq.h Thomas Gleixner
2011-02-10 23:38 ` [patch 62/75] genirq: Add flags to irq_chip Thomas Gleixner
2011-02-10 23:38 ` [patch 63/75] genirq: Add IRQCHIP_SET_TYPE_MASKED flag and IRQD_WAKE_SET Thomas Gleixner
2011-02-14 17:07   ` Rabin Vincent
2011-02-14 18:43     ` Thomas Gleixner
2011-02-10 23:38 ` [patch 64/75] genirq: Move wakeup state to irq_data Thomas Gleixner
2011-02-10 23:38 ` [patch 65/75] genirq: Reflect IRQ_INPROGRESS/DISABLED in irq_data.state Thomas Gleixner
2011-02-10 23:38 ` [patch 66/75] genirq: Reflect IRQ_MOVE_PCNTXT in irq_data state Thomas Gleixner
2011-02-10 23:38 ` [patch 67/75] genirq: Remove desc->status when GENERIC_HARDIRQS_NO_COMPAT=y Thomas Gleixner
2011-02-10 23:38 ` [patch 68/75] genirq: Add preflow handler support Thomas Gleixner
2011-02-10 23:38 ` [patch 69/75] genirq: Implement irq_data based move_*_irq() versions Thomas Gleixner
2011-02-10 23:38 ` [patch 70/75] x86: Fixup deprecation warnings Thomas Gleixner
2011-02-10 23:38 ` [patch 71/75] x86: ioapic: Use irq_data->state Thomas Gleixner
2011-02-10 23:38 ` [patch 72/75] x86: Use the proper accessors in fixup_irqs() Thomas Gleixner
2011-02-10 23:38 ` [patch 73/75] x86: ioapic: Use new move_irq functions Thomas Gleixner
2011-02-10 23:38 ` [patch 74/75] x86: Use generic show_interrupts Thomas Gleixner
2011-02-10 23:38 ` [patch 75/75] x86: Disable deprecated GENIRQ features Thomas Gleixner
2011-02-10 23:53 ` [patch 00/75] genirq: Overhaul for 2.6.39 Linus Torvalds
2011-02-11  0:00   ` Thomas Gleixner
2011-02-11  0:28     ` Linus Torvalds
2011-02-11  0:49       ` Thomas Gleixner
2011-02-11 13:05         ` Thomas Gleixner
2011-02-11 13:59           ` Ingo Molnar
2011-02-11 14:26             ` Thomas Gleixner
2011-02-13 12:50               ` Sam Ravnborg
2011-02-14 19:01                 ` Thomas Gleixner
2011-02-11  4:03 ` Frank Rowand

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110210223258.556677117@linutronix.de \
    --to=tglx@linutronix.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=peterz@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.