Re: [RFC][PATCH 1/4] PM: Rework handling of interrupts during suspend-resume (rev. 4)

Linus Torvalds
2009-03-02T23:34:30Z

On Mon, 2 Mar 2009, Arve Hjønnevåg wrote:
>
> > enable_irq() clears IRQ_SUSPENDED.  This has already been discussed btw.
>
> I'm if I missed that discussion, but enable_irq cannot know who is
> calling it and therefore cannot know if IRQ_SUSPENDED should be
> cleared.

Sure it can.

If IRQ_SUSPENDED is not set, then clearing it is a no-op, so that's fine.

If IRQ_SUSPENDED _is_ set, then that means that we're after the
suspend_late() sequence and before the resume_early() sequence, and no
device driver is possibly called in between, so they'd sure better not be
doing anything that does an enable_irq().

IOW, we know who the caller is, simply because there can be no other valid
caller!

Linus