diff options
| author | Thomas Gleixner <tglx@linutronix.de> | 2014-08-28 10:49:43 -0400 |
|---|---|---|
| committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2014-09-01 07:48:21 -0400 |
| commit | 092fadd59b50208f6859f89dd7ea84e03955b544 (patch) | |
| tree | 7266c77f62a4e69d93ba110d14f7e3e76df1071d | |
| parent | 5417de222393164b87b2d142b6ec332be40a2564 (diff) | |
genirq: Move MASK_ON_SUSPEND handling into suspend_device_irqs()
There is no reason why we should delay the masking of interrupts whose
interrupt chip requests MASK_ON_SUSPEND to the point where we check
the wakeup interrupts. We can do it right at the point where we mark
the interrupt as suspended.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
| -rw-r--r-- | kernel/irq/pm.c | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/kernel/irq/pm.c b/kernel/irq/pm.c index 74ca6bb541d5..a21b3dc9825a 100644 --- a/kernel/irq/pm.c +++ b/kernel/irq/pm.c | |||
| @@ -56,6 +56,15 @@ static void suspend_device_irq(struct irq_desc *desc, int irq) | |||
| 56 | 56 | ||
| 57 | desc->istate |= IRQS_SUSPENDED; | 57 | desc->istate |= IRQS_SUSPENDED; |
| 58 | __disable_irq(desc, irq); | 58 | __disable_irq(desc, irq); |
| 59 | |||
| 60 | /* | ||
| 61 | * Hardware which has no wakeup source configuration facility | ||
| 62 | * requires that the non wakeup interrupts are masked at the | ||
| 63 | * chip level. The chip implementation indicates that with | ||
| 64 | * IRQCHIP_MASK_ON_SUSPEND. | ||
| 65 | */ | ||
| 66 | if (irq_desc_get_chip(desc)->flags & IRQCHIP_MASK_ON_SUSPEND) | ||
| 67 | mask_irq(desc); | ||
| 59 | } | 68 | } |
| 60 | 69 | ||
| 61 | /** | 70 | /** |
| @@ -176,19 +185,7 @@ int check_wakeup_irqs(void) | |||
| 176 | if (irqd_is_wakeup_set(&desc->irq_data)) { | 185 | if (irqd_is_wakeup_set(&desc->irq_data)) { |
| 177 | if (desc->depth == 1 && desc->istate & IRQS_PENDING) | 186 | if (desc->depth == 1 && desc->istate & IRQS_PENDING) |
| 178 | return -EBUSY; | 187 | return -EBUSY; |
| 179 | continue; | ||
| 180 | } | 188 | } |
| 181 | /* | ||
| 182 | * Check the non wakeup interrupts whether they need | ||
| 183 | * to be masked before finally going into suspend | ||
| 184 | * state. That's for hardware which has no wakeup | ||
| 185 | * source configuration facility. The chip | ||
| 186 | * implementation indicates that with | ||
| 187 | * IRQCHIP_MASK_ON_SUSPEND. | ||
| 188 | */ | ||
| 189 | if (desc->istate & IRQS_SUSPENDED && | ||
| 190 | irq_desc_get_chip(desc)->flags & IRQCHIP_MASK_ON_SUSPEND) | ||
| 191 | mask_irq(desc); | ||
| 192 | } | 189 | } |
| 193 | 190 | ||
| 194 | return 0; | 191 | return 0; |
