public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] irq: Warn when shared interrupts do not match on NO_SUSPEND
@ 2014-07-24 13:39 Peter Zijlstra
  2014-07-24 13:46 ` Thomas Gleixner
  2014-07-24 15:36 ` [tip:irq/core] " tip-bot for Peter Zijlstra
  0 siblings, 2 replies; 6+ messages in thread
From: Peter Zijlstra @ 2014-07-24 13:39 UTC (permalink / raw)
  To: Thomas Gleixner; +Cc: rjw, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1222 bytes --]

Subject: irq: Warn when shared interrupts do not match on NO_SUSPEND

When suspend_device_irqs() iterates all descriptors, its pointless if
one has NO_SUSPEND set while another has not.

Validate on request_irq() that NO_SUSPEND state maches for SHARED
interrupts.

Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Peter Zijlstra <peterz@infradead.org>
---
 kernel/irq/manage.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c
index 88657d7bc9dd..27a1fe028afb 100644
--- a/kernel/irq/manage.c
+++ b/kernel/irq/manage.c
@@ -1077,9 +1077,12 @@ __setup_irq(unsigned int irq, struct irq_desc *desc, struct irqaction *new)
 		 * set the trigger type must match. Also all must
 		 * agree on ONESHOT.
 		 */
+
+#define IRQF_MISMATCH \
+	(IRQF_TRIGGER_MASK | IRQF_ONESHOT | IRQF_NO_SUSPEND)
+
 		if (!((old->flags & new->flags) & IRQF_SHARED) ||
-		    ((old->flags ^ new->flags) & IRQF_TRIGGER_MASK) ||
-		    ((old->flags ^ new->flags) & IRQF_ONESHOT))
+		    ((old->flags ^ new->flags) & IRQF_MISMATCH))
 			goto mismatch;
 
 		/* All handlers must agree on per-cpuness */

[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2014-07-31  2:03 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-24 13:39 [PATCH] irq: Warn when shared interrupts do not match on NO_SUSPEND Peter Zijlstra
2014-07-24 13:46 ` Thomas Gleixner
2014-07-24 14:15   ` Peter Zijlstra
2014-07-24 14:39     ` Rafael J. Wysocki
2014-07-24 15:36 ` [tip:irq/core] " tip-bot for Peter Zijlstra
2014-07-31  2:22   ` Rafael J. Wysocki

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox