Re: [PATCH 2/5 v3] irq / PM: Make wakeup interrupts work with suspend-to-idle

From: Thomas Gleixner
Date: Thu Aug 28 2014 - 05:23:24 EST


On Thu, 28 Aug 2014, Rafael J. Wysocki wrote:
> On Wednesday, August 27, 2014 10:32:23 PM Thomas Gleixner wrote:
> > void suspend_device_irqs(void)
> > {
> > for_each_irq_desc(irq, desc) {
> > /* Disable the interrupt unconditionally */
> > disable_irq(irq);
>
> We still need to skip the IRQF_NO_SUSPEND stuff (eg. timers), so I guess
> everything left disabled here needs to be IRQS_SUSPENDED, so we know which
> ones to re-enable in resume_device_irqs().

Right. I skipped that one for simplicity. I wanted to look into the
whole maze today again with brain awake. I think it's simple to
integrate the no suspend magic here and have a separate handler for
it.

> >
> > /* Is the irq a wakeup source? */
> > if (!irqd_is_wakeup_set(&desc->irq_data))
> > continue;
> >
> > /* Replace the handler */
> > raw_spin_lock_irqsave(&desc->lock, flags);
> > desc->saved_handler = desc->handler;
> > desc->handler = handle_wakeup_irq;
>
> Hmm. There's no handler field in struct irq_desc (/me is puzzled).
>
> Did you mean handle_irq (I think you did)?

Yup.

> There is quite some ugliness related to resume_irqs(), the want_early thing
> and IRQF_EARLY_RESUME / IRQF_FORCE_RESUME. I guess that needs to be preserved?

Probably. Did not look into the madness of that yet.

Thanks,

tglx
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/