Skip to content

Commit a696712

Browse files
jgross1KAGA-KOKO
authored andcommitted
genirq/PM: Properly pretend disabled state when force resuming interrupts
Interrupts with the IRQF_FORCE_RESUME flag set have also the IRQF_NO_SUSPEND flag set. They are not disabled in the suspend path, but must be forcefully resumed. That's used by XEN to keep IPIs enabled beyond the suspension of device irqs. Force resume works by pretending that the interrupt was disabled and then calling __irq_enable(). Incrementing the disabled depth counter was enough to do that, but with the recent changes which use state flags to avoid unnecessary hardware access, this is not longer sufficient. If the state flags are not set, then the hardware callbacks are not invoked and the interrupt line stays disabled in "hardware". Set the disabled and masked state when pretending that an interrupt got disabled by suspend. Fixes: bf22ff4 ("genirq: Avoid unnecessary low level irq function calls") Suggested-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Juergen Gross <jgross@suse.com> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Cc: xen-devel@lists.xenproject.org Cc: boris.ostrovsky@oracle.com Link: http://lkml.kernel.org/r/20170717174703.4603-2-jgross@suse.com
1 parent 935acd3 commit a696712

3 files changed

Lines changed: 12 additions & 10 deletions

File tree

‎kernel/irq/chip.c‎

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -170,21 +170,11 @@ static void irq_state_clr_disabled(struct irq_desc *desc)
170170
irqd_clear(&desc->irq_data, IRQD_IRQ_DISABLED);
171171
}
172172

173-
static void irq_state_set_disabled(struct irq_desc *desc)
174-
{
175-
irqd_set(&desc->irq_data, IRQD_IRQ_DISABLED);
176-
}
177-
178173
static void irq_state_clr_masked(struct irq_desc *desc)
179174
{
180175
irqd_clear(&desc->irq_data, IRQD_IRQ_MASKED);
181176
}
182177

183-
static void irq_state_set_masked(struct irq_desc *desc)
184-
{
185-
irqd_set(&desc->irq_data, IRQD_IRQ_MASKED);
186-
}
187-
188178
static void irq_state_clr_started(struct irq_desc *desc)
189179
{
190180
irqd_clear(&desc->irq_data, IRQD_IRQ_STARTED);

‎kernel/irq/internals.h‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,16 @@ static inline bool irqd_has_set(struct irq_data *d, unsigned int mask)
227227
return __irqd_to_state(d) & mask;
228228
}
229229

230+
static inline void irq_state_set_disabled(struct irq_desc *desc)
231+
{
232+
irqd_set(&desc->irq_data, IRQD_IRQ_DISABLED);
233+
}
234+
235+
static inline void irq_state_set_masked(struct irq_desc *desc)
236+
{
237+
irqd_set(&desc->irq_data, IRQD_IRQ_MASKED);
238+
}
239+
230240
#undef __irqd_to_state
231241

232242
static inline void kstat_incr_irqs_this_cpu(struct irq_desc *desc)

‎kernel/irq/pm.c‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,8 @@ static void resume_irq(struct irq_desc *desc)
149149

150150
/* Pretend that it got disabled ! */
151151
desc->depth++;
152+
irq_state_set_disabled(desc);
153+
irq_state_set_masked(desc);
152154
resume:
153155
desc->istate &= ~IRQS_SUSPENDED;
154156
__enable_irq(desc);

0 commit comments

Comments
 (0)