Re: [PATCH] PM / wakeirq: report wakeup events in dedicated wake-IRQs
From: Alan Stern
Date: Fri Nov 11 2016 - 16:09:32 EST
On Fri, 11 Nov 2016, Brian Norris wrote:
> > The wakeup interrupt controller knows something happened earlier,
> > so maybe it could report that time if queried somehow?
>
> Sort of. We have /sys/power/pm_wakeup_irq already. But it's really less
> useful to get IRQ-level stats for this, than to get device info. AFAICT,
> there's no machine-readable association between IRQs and devices; the
> best you can get is by parsing the names in /proc/interrupts.
>
> Or, if we really want to say that's sufficient, then maybe we should
> kill all the device-level wakeup stats in sysfs... (Is that what the
> flamewar was all about? I hope I'm not poking the hornet's nest.)
If I recall correctly, that flamewar was about the whole idea of what
caused the system to wake up. In general, the system does not know
what caused it to wake up. All it knows, once it is awake again, is
what IRQs (or other similar events, such as ACPI GPEs) are pending. It
doesn't know which of those events caused it to wake up. And if
multiple devices share the same IRQ line, the PM core won't know which
of them raised the IRQ.
Of course, for some purposes this distinction doesn't matter.
Alan Stern