Re: [PATCH] genirq: Clarify that irq wake state is orthogonal to enable/disable

From: Thomas Gleixner
Date: Thu Feb 06 2020 - 04:43:34 EST


Stephen Boyd <swboyd@xxxxxxxxxxxx> writes:
> Quoting Thomas Gleixner (2020-02-05 04:27:06)
>> > * Wakeup mode lets this IRQ wake the system from sleep
>> > * states like "suspend to RAM".
>> > + *
>> > + * Note: irq enable/disable state is completely orthogonal
>> > + * to the enable/disable state of irq wake. An irq can be
>> > + * disabled with disable_irq() and still wake the system as
>> > + * long as the irq has wake enabled.
>>
>> It clearly should say that this is really depending on the hardware
>> implementation of the particual interrupt chip whether disabled + wake
>> mode is supported.
>>
>
> Ok. I'm having trouble parsing this. Is there a consistent wording that
> can be put here?

See below.

> The API seems fraught with peril if an implementation of an irqchip is
> allowed to ignore wakeup on interrupts that are marked for wakeup while
> the irq is disabled. Driver writers won't be able to write drivers that
> work across implementations if the irq can't wake the system reliably.

It's not really well defined but thats a result of the gazillion
variants of irq chips which all have their own quirks. The wakeup
mechansims are also widely different, some of them are built into the
SOC, others require external logic. And a large part of these things is
completely undocumented. Welcome to my wonderful world.

So versus consistent wording. I'm fine with the paragraph you suggested,
but please amend it with something like this:

If this does not hold, then either the underlying irq chip and the
related driver need to be investigated.

Thanks,

tglx