summaryrefslogtreecommitdiffstats
path: root/kernel/irq
diff options
context:
space:
mode:
authorPeter Zijlstra <peterz@infradead.org>2014-07-24 15:39:21 +0200
committerThomas Gleixner <tglx@linutronix.de>2014-07-24 17:32:56 +0200
commit4fae4e7624653ef498d0e2a38f00620b9701ab04 (patch)
treeb54ebbc2342f696970bf2c760087a48cc8be09b6 /kernel/irq
parent1b0733837a9b2b8e006c787c628d0085073a5c36 (diff)
downloadlinux-stable-4fae4e7624653ef498d0e2a38f00620b9701ab04.tar.gz
linux-stable-4fae4e7624653ef498d0e2a38f00620b9701ab04.tar.bz2
linux-stable-4fae4e7624653ef498d0e2a38f00620b9701ab04.zip
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. Signed-off-by: Peter Zijlstra <peterz@infradead.org> Acked-by: "Rafael J. Wysocki" <rjw@rjwysocki.net> Link: http://lkml.kernel.org/r/20140724133921.GY6758@twins.programming.kicks-ass.net Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'kernel/irq')
-rw-r--r--kernel/irq/manage.c7
1 files 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 */