Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Thomas Gleixner and committed by
Rafael J. Wysocki
b76f1674 c7bd3ec0

+13
+8
include/linux/irq.h
··· 173 173 * IRQD_IRQ_DISABLED - Disabled state of the interrupt 174 174 * IRQD_IRQ_MASKED - Masked state of the interrupt 175 175 * IRQD_IRQ_INPROGRESS - In progress state of the interrupt 176 + * IRQD_WAKEUP_ARMED - Wakeup mode armed 176 177 */ 177 178 enum { 178 179 IRQD_TRIGGER_MASK = 0xf, ··· 187 186 IRQD_IRQ_DISABLED = (1 << 16), 188 187 IRQD_IRQ_MASKED = (1 << 17), 189 188 IRQD_IRQ_INPROGRESS = (1 << 18), 189 + IRQD_WAKEUP_ARMED = (1 << 19), 190 190 }; 191 191 192 192 static inline bool irqd_is_setaffinity_pending(struct irq_data *d) ··· 258 256 { 259 257 return d->state_use_accessors & IRQD_IRQ_INPROGRESS; 260 258 } 259 + 260 + static inline bool irqd_is_wakeup_armed(struct irq_data *d) 261 + { 262 + return d->state_use_accessors & IRQD_WAKEUP_ARMED; 263 + } 264 + 261 265 262 266 /* 263 267 * Functions for chained handlers which can be enabled/disabled by the
+5
kernel/irq/pm.c
··· 54 54 if (!desc->action || desc->no_suspend_depth) 55 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 60 desc->istate |= IRQS_SUSPENDED; 58 61 __disable_irq(desc, irq); 59 62 ··· 104 101 105 102 static void resume_irq(struct irq_desc *desc, int irq) 106 103 { 104 + irqd_clear(&desc->irq_data, IRQD_WAKEUP_ARMED); 105 + 107 106 if (desc->istate & IRQS_SUSPENDED) 108 107 goto resume; 109 108