All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ulf Hansson <ulf.hansson@linaro.org>
To: "Rafael J . Wysocki" <rjw@rjwysocki.net>, linux-pm@vger.kernel.org
Cc: Kevin Hilman <khilman@kernel.org>,
	Viresh Kumar <viresh.kumar@linaro.org>,
	Geert Uytterhoeven <geert+renesas@glider.be>,
	Simon Horman <horms@verge.net.au>,
	Niklas Soderlund <niklas.soderlund+renesas@ragnatech.se>,
	Vincent Guittot <vincent.guittot@linaro.org>,
	linux-renesas-soc@vger.kernel.org,
	Ulf Hansson <ulf.hansson@linaro.org>
Subject: [PATCH v2 3/4] PM / Domains: Take WAKEUP_PATH driver flag into account in genpd
Date: Fri, 29 Dec 2017 12:37:02 +0100	[thread overview]
Message-ID: <1514547423-18965-4-git-send-email-ulf.hansson@linaro.org> (raw)
In-Reply-To: <1514547423-18965-1-git-send-email-ulf.hansson@linaro.org>

In case the WAKEUP_PATH flag has been set in a later phase than from the
->suspend() callback, the PM core don't set the ->power.wakeup_path status
flag for the device. Therefore, let's be safe and check it explicitly.

Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
---
 drivers/base/power/domain.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c
index f9dcc98..32b4ba7 100644
--- a/drivers/base/power/domain.c
+++ b/drivers/base/power/domain.c
@@ -1038,7 +1038,9 @@ static int genpd_finish_suspend(struct device *dev, bool poweroff)
 	if (IS_ERR(genpd))
 		return -EINVAL;
 
-	if (dev->power.wakeup_path && genpd_is_active_wakeup(genpd))
+	if ((dev->power.wakeup_path ||
+	    dev_pm_test_driver_flags(dev, DPM_FLAG_WAKEUP_PATH)) &&
+	    genpd_is_active_wakeup(genpd))
 		return 0;
 
 	if (poweroff)
@@ -1093,7 +1095,9 @@ static int genpd_resume_noirq(struct device *dev)
 	if (IS_ERR(genpd))
 		return -EINVAL;
 
-	if (dev->power.wakeup_path && genpd_is_active_wakeup(genpd))
+	if ((dev->power.wakeup_path ||
+	    dev_pm_test_driver_flags(dev, DPM_FLAG_WAKEUP_PATH)) &&
+	    genpd_is_active_wakeup(genpd))
 		return 0;
 
 	genpd_lock(genpd);
-- 
2.7.4

  parent reply	other threads:[~2017-12-29 11:37 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-29 11:36 [PATCH v2 0/4] PM / core: Extend behaviour for wakeup paths Ulf Hansson
2017-12-29 11:37 ` [PATCH v2 1/4] PM / core: Assign the wakeup_path status flag in __device_prepare() Ulf Hansson
2017-12-30  0:44   ` Rafael J. Wysocki
2018-01-02 11:36     ` Ulf Hansson
2018-01-02 11:43       ` Rafael J. Wysocki
2018-01-02 13:17         ` Ulf Hansson
2017-12-29 11:37 ` [PATCH v2 2/4] PM / core: Add WAKEUP_PATH driver flag Ulf Hansson
2017-12-29 11:37 ` Ulf Hansson [this message]
2017-12-30  0:47   ` [PATCH v2 3/4] PM / Domains: Take WAKEUP_PATH driver flag into account in genpd Rafael J. Wysocki
2018-01-02 11:46     ` Ulf Hansson
2018-01-02 11:52       ` Rafael J. Wysocki
2017-12-29 11:37 ` [PATCH v2 4/4] PM / core: Print warn if device gets enabled as wakeup source during sleep Ulf Hansson
2017-12-30  0:58   ` Rafael J. Wysocki
2018-01-02 12:30     ` Ulf Hansson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1514547423-18965-4-git-send-email-ulf.hansson@linaro.org \
    --to=ulf.hansson@linaro.org \
    --cc=geert+renesas@glider.be \
    --cc=horms@verge.net.au \
    --cc=khilman@kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=niklas.soderlund+renesas@ragnatech.se \
    --cc=rjw@rjwysocki.net \
    --cc=vincent.guittot@linaro.org \
    --cc=viresh.kumar@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.