From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965195AbcKKVJ3 (ORCPT ); Fri, 11 Nov 2016 16:09:29 -0500 Received: from netrider.rowland.org ([192.131.102.5]:40923 "HELO netrider.rowland.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S937874AbcKKVJ0 (ORCPT ); Fri, 11 Nov 2016 16:09:26 -0500 Date: Fri, 11 Nov 2016 16:09:25 -0500 (EST) From: Alan Stern X-X-Sender: stern@netrider.rowland.org To: Brian Norris cc: Tony Lindgren , Dmitry Torokhov , "Rafael J . Wysocki" , Pavel Machek , Len Brown , Greg Kroah-Hartman , lkml , Brian Norris , "linux-pm@vger.kernel.org" Subject: Re: [PATCH] PM / wakeirq: report wakeup events in dedicated wake-IRQs In-Reply-To: <20161111194041.GA111624@google.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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