aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2014-08-29 07:54:09 -0400
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2014-09-01 07:48:51 -0400
commitb76f16748fa61801b1a1fd3ffb6f25ee228a35e0 (patch)
tree50303dcc7296e35d0f382ee97ddf78d8df28b785
parentc7bd3ec0531aa636ad57ed9f27e637cbd247e64a (diff)
genirq: Mark wakeup sources as armed on suspend
This allows us to utilize this information in the irq_may_run() check without adding another conditional to the fast path. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
-rw-r--r--include/linux/irq.h8
-rw-r--r--kernel/irq/pm.c5
2 files changed, 13 insertions, 0 deletions
diff --git a/include/linux/irq.h b/include/linux/irq.h
index 62af59242ddc..03f48d936f66 100644
--- a/include/linux/irq.h
+++ b/include/linux/irq.h
@@ -173,6 +173,7 @@ struct irq_data {
173 * IRQD_IRQ_DISABLED - Disabled state of the interrupt 173 * IRQD_IRQ_DISABLED - Disabled state of the interrupt
174 * IRQD_IRQ_MASKED - Masked state of the interrupt 174 * IRQD_IRQ_MASKED - Masked state of the interrupt
175 * IRQD_IRQ_INPROGRESS - In progress state of the interrupt 175 * IRQD_IRQ_INPROGRESS - In progress state of the interrupt
176 * IRQD_WAKEUP_ARMED - Wakeup mode armed
176 */ 177 */
177enum { 178enum {
178 IRQD_TRIGGER_MASK = 0xf, 179 IRQD_TRIGGER_MASK = 0xf,
@@ -186,6 +187,7 @@ enum {
186 IRQD_IRQ_DISABLED = (1 << 16), 187 IRQD_IRQ_DISABLED = (1 << 16),
187 IRQD_IRQ_MASKED = (1 << 17), 188 IRQD_IRQ_MASKED = (1 << 17),
188 IRQD_IRQ_INPROGRESS = (1 << 18), 189 IRQD_IRQ_INPROGRESS = (1 << 18),
190 IRQD_WAKEUP_ARMED = (1 << 19),
189}; 191};
190 192
191static inline bool irqd_is_setaffinity_pending(struct irq_data *d) 193static inline bool irqd_is_setaffinity_pending(struct irq_data *d)
@@ -257,6 +259,12 @@ static inline bool irqd_irq_inprogress(struct irq_data *d)
257 return d->state_use_accessors & IRQD_IRQ_INPROGRESS; 259 return d->state_use_accessors & IRQD_IRQ_INPROGRESS;
258} 260}
259 261
262static inline bool irqd_is_wakeup_armed(struct irq_data *d)
263{
264 return d->state_use_accessors & IRQD_WAKEUP_ARMED;
265}
266
267
260/* 268/*
261 * Functions for chained handlers which can be enabled/disabled by the 269 * Functions for chained handlers which can be enabled/disabled by the
262 * standard disable_irq/enable_irq calls. Must be called with 270 * standard disable_irq/enable_irq calls. Must be called with
diff --git a/kernel/irq/pm.c b/kernel/irq/pm.c
index cf0ce0163db9..766930eaeed9 100644
--- a/kernel/irq/pm.c
+++ b/kernel/irq/pm.c
@@ -54,6 +54,9 @@ static bool suspend_device_irq(struct irq_desc *desc, int irq)
54 if (!desc->action || desc->no_suspend_depth) 54 if (!desc->action || desc->no_suspend_depth)
55 return false; 55 return false;
56 56
57 if (irqd_is_wakeup_set(&desc->irq_data))
58 irqd_set(&desc->irq_data, IRQD_WAKEUP_ARMED);
59
57 desc->istate |= IRQS_SUSPENDED; 60 desc->istate |= IRQS_SUSPENDED;
58 __disable_irq(desc, irq); 61 __disable_irq(desc, irq);
59 62
@@ -101,6 +104,8 @@ EXPORT_SYMBOL_GPL(suspend_device_irqs);
101 104
102static void resume_irq(struct irq_desc *desc, int irq) 105static void resume_irq(struct irq_desc *desc, int irq)
103{ 106{
107 irqd_clear(&desc->irq_data, IRQD_WAKEUP_ARMED);
108
104 if (desc->istate & IRQS_SUSPENDED) 109 if (desc->istate & IRQS_SUSPENDED)
105 goto resume; 110 goto resume;
106 111