Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp1300916ybp; Wed, 9 Oct 2019 11:54:09 -0700 (PDT) X-Google-Smtp-Source: APXvYqwrj1358X+P3BRCSs7zE09lLGJAtoSHsTFI1uzJOoy2wAE9Daj/gnlv7Xaz1Wi4f9lkZ00W X-Received: by 2002:a17:906:130c:: with SMTP id w12mr4185140ejb.142.1570647249427; Wed, 09 Oct 2019 11:54:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570647249; cv=none; d=google.com; s=arc-20160816; b=dST+dNBXyKkw8m3DQwZqQkQDtD6zNBTx9L+jTSjz+hstniR3z0xOpwEl/Jkcd6FSBk APzKt10QkHrEJ5x2uD+Hy/nY2R/eU2HWeQ6C07fOvMRfSbSIimIwZeGZVgP22LUSpwnU SWYEdOw1uDZDg3p0Cmm/wM1LyifrrPqeYfI1bLT29KVUY412IIqpuWuvTvl9AUUsVCit pfWP8xsPO91qXk+HCArOIciBPzWdowSLg9sES9b5oTqTa3EQseoU8dfSmqsD5oQVxjDf idjpZ5YLmjY9uNc7oTufVkYn5xy7ShhoV85LQwORVREidD7a6XrRiOqEg6aRDC9bTheh aauw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:in-reply-to :subject:cc:to:from:date; bh=audzAwv5lRvL9ae2QkRLL2Hr8s2TSXhbXM/0YcProps=; b=hMJXiVxmpouiHjNzNHr/Qps+1yuHHNQx+D9e94aQ4DxOPU4FWFjGY1DF4iflZr1yn5 /5z/jfJ+VhOk0xIToDTz6djnj8UdkoE85YMFKjpCyKB+LE1FrHotyvsHMJkAYFQlZ38X yNfOAo2iSqNY6PKpgEeC4FbRfDH2OzybWyQoOu6YT69PYvFe0BXEedjnt+JniCpkCQX8 LHnNbHmxo6rgLA+NiOA2EWvQ8GQqMj1HQXbqy4mvej3R1R/Gx5bE0W8mWXLlN7OkPhZs qmw7B2qz82Ek32SYHiS3L8SIoXZpaYKMpmm/ITIpKcP1/y2I7vnSilZbmtRAYkpY7obu EfMw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d25si1615076edv.319.2019.10.09.11.53.45; Wed, 09 Oct 2019 11:54:09 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731287AbfJISvV (ORCPT + 99 others); Wed, 9 Oct 2019 14:51:21 -0400 Received: from iolanthe.rowland.org ([192.131.102.54]:51736 "HELO iolanthe.rowland.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1730490AbfJISvU (ORCPT ); Wed, 9 Oct 2019 14:51:20 -0400 Received: (qmail 6328 invoked by uid 2102); 9 Oct 2019 14:51:19 -0400 Received: from localhost (sendmail-bs@127.0.0.1) by localhost with SMTP; 9 Oct 2019 14:51:19 -0400 Date: Wed, 9 Oct 2019 14:51:19 -0400 (EDT) From: Alan Stern X-X-Sender: stern@iolanthe.rowland.org To: Tony Lindgren cc: "Rafael J . Wysocki" , Dmitry Torokhov , Grygorii Strashko , Ulf Hansson , , Subject: Re: [PATCH] PM / runtime: Add support for wake-up reason for wakeirqs In-Reply-To: <20191009182803.63742-1-tony@atomide.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 9 Oct 2019, Tony Lindgren wrote: > With generic wakeirqs we can wake a device, but do not know if the > device woke to a wakeirq. Let's add pm_runtime_wakeup_is_wakeirq() so > a device can check the wake-up reason. People have tried many times over the years to do something like this. It's never right. The problem is simple: It's impossible to know for certain why the system woke up from suspend. In fact, there may be many wakeup sources all active at the same time, and any of them could be the one responsible for actually waking the system. All you can do is check to see whether a particular wakeup source is active at the present moment. You can't tell whether it was active in the past (while the system was suspended) or whether it caused the system to resume. Alan Stern