aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/irq/pm.c
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2014-08-28 05:44:31 -0400
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2014-09-01 07:48:05 -0400
commitcab303be91dc47942bc25de33dc1140123540800 (patch)
treefdfec3ef37665af47af9010419e8f1c2236b0e0f /kernel/irq/pm.c
parent8df2e02c5c4de9e65ee60153dd9c442356534ad9 (diff)
genirq: Add sanity checks for PM options on shared interrupt lines
Account the IRQF_NO_SUSPEND and IRQF_RESUME_EARLY actions on shared interrupt lines and yell loudly if there is a mismatch. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'kernel/irq/pm.c')
-rw-r--r--kernel/irq/pm.c36
1 files changed, 36 insertions, 0 deletions
diff --git a/kernel/irq/pm.c b/kernel/irq/pm.c
index b84141dcee5e..1b1b67a73218 100644
--- a/kernel/irq/pm.c
+++ b/kernel/irq/pm.c
@@ -13,6 +13,42 @@
13 13
14#include "internals.h" 14#include "internals.h"
15 15
16/*
17 * Called from __setup_irq() with desc->lock held after @action has
18 * been installed in the action chain.
19 */
20void irq_pm_install_action(struct irq_desc *desc, struct irqaction *action)
21{
22 desc->nr_actions++;
23
24 if (action->flags & IRQF_FORCE_RESUME)
25 desc->force_resume_depth++;
26
27 WARN_ON_ONCE(desc->force_resume_depth &&
28 desc->force_resume_depth != desc->nr_actions);
29
30 if (action->flags & IRQF_NO_SUSPEND)
31 desc->no_suspend_depth++;
32
33 WARN_ON_ONCE(desc->no_suspend_depth &&
34 desc->no_suspend_depth != desc->nr_actions);
35}
36
37/*
38 * Called from __free_irq() with desc->lock held after @action has
39 * been removed from the action chain.
40 */
41void irq_pm_remove_action(struct irq_desc *desc, struct irqaction *action)
42{
43 desc->nr_actions--;
44
45 if (action->flags & IRQF_FORCE_RESUME)
46 desc->force_resume_depth--;
47
48 if (action->flags & IRQF_NO_SUSPEND)
49 desc->no_suspend_depth--;
50}
51
16static void suspend_device_irq(struct irq_desc *desc, int irq) 52static void suspend_device_irq(struct irq_desc *desc, int irq)
17{ 53{
18 if (!desc->action || (desc->action->flags & IRQF_NO_SUSPEND)) 54 if (!desc->action || (desc->action->flags & IRQF_NO_SUSPEND))