Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755898AbcKJVkS (ORCPT ); Thu, 10 Nov 2016 16:40:18 -0500 Received: from mail-pf0-f180.google.com ([209.85.192.180]:33955 "EHLO mail-pf0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753302AbcKJVkO (ORCPT ); Thu, 10 Nov 2016 16:40:14 -0500 Date: Thu, 10 Nov 2016 13:39:17 -0800 From: Brian Norris To: Pavel Machek Cc: "Rafael J . Wysocki" , Len Brown , Greg Kroah-Hartman , linux-kernel@vger.kernel.org, Brian Norris , linux-pm@vger.kernel.org, Tony Lindgren , Dmitry Torokhov Subject: Re: [PATCH] PM / wakeirq: report wakeup events in dedicated wake-IRQs Message-ID: <20161110213917.GB108490@google.com> References: <1478801227-65527-1-git-send-email-briannorris@chromium.org> <20161110205720.GB31728@amd> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20161110205720.GB31728@amd> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1364 Lines: 34 On Thu, Nov 10, 2016 at 09:57:20PM +0100, Pavel Machek wrote: > On Thu 2016-11-10 10:07:07, Brian Norris wrote: > > It's important that user space can figure out what device woke the > > system from suspend -- e.g., for debugging, or for implementing > > conditional wake behavior. Dedicated wakeup IRQs don't currently do > > that. > > > > Let's report the event (pm_wakeup_event()) and also allow drivers to > > synchronize with these events in their resume path (hence, disable_irq() > > instead of disable_irq_nosync()). > > > > Signed-off-by: Brian Norris > > How is this supposed to be presented to userspace? /sys/kernel/debug/wakeup_sources or /sys/devices/.../power/wakeup*, for some examples. > There was big flamewar about that some time ago, and "what woke up the > system" is pretty much meaningless, and certainly unavailable on most > PC class hardware. OK... I'm not privy to the flamewar, but I'm also not sure how it's relevant here. These APIs specifically handle an IRQ that is solely used for wakeup purposes, and so it should clearly be able to tell us something about who/what woke the system. > Good question to ask is "what wakeup events > happened while the userspace was not available".... That's what I'm patching here. handle_threaded_wake_irq() makes no note of the wake event at the moment. Brian