From: Derek Basehore <dbasehore@chromium.org>
To: linux-pm@vger.kernel.org
Cc: "Rafael J . Wysocki" <rjw@rjwysocki.net>,
Len Brown <len.brown@intel.com>, Pavel Machek <pavel@ucw.cz>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
linux-kernel@vger.kernel.org,
"Martin K . Petersen" <martin.petersen@oracle.com>,
linux-scsi@vger.kernel.org,
Derek Basehore <dbasehore@chromium.org>
Subject: [PATCH v2 2/3] PM / sleep: try to runtime suspend for direct complete
Date: Wed, 24 Feb 2016 16:22:27 -0800 [thread overview]
Message-ID: <1456359748-22838-2-git-send-email-dbasehore@chromium.org> (raw)
In-Reply-To: <1456359748-22838-1-git-send-email-dbasehore@chromium.org>
This tries to runtime suspend devices that are still active for direct
complete. This is for cases such as autosuspend delays which leaves
devices able to runtime suspend but still active. It's beneficial in
this case to runtime suspend the device to take advantage of direct
complete when possible.
Signed-off-by: Derek Basehore <dbasehore@chromium.org>
Reviewed-by: Eric Caruso <ejcaruso@chromium.org>
---
drivers/base/power/main.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/drivers/base/power/main.c b/drivers/base/power/main.c
index e0017d9..9693032 100644
--- a/drivers/base/power/main.c
+++ b/drivers/base/power/main.c
@@ -1380,7 +1380,12 @@ static int __device_suspend(struct device *dev, pm_message_t state, bool async)
goto Complete;
if (dev->power.direct_complete) {
- if (pm_runtime_status_suspended(dev)) {
+ /*
+ * Check if we're runtime suspended. If not, try to runtime
+ * suspend for autosuspend cases.
+ */
+ if (pm_runtime_status_suspended(dev) ||
+ !pm_runtime_suspend(dev)) {
pm_runtime_disable(dev);
if (pm_runtime_status_suspended(dev))
goto Complete;
--
2.7.0.rc3.207.g0ac5344
next prev parent reply other threads:[~2016-02-25 0:22 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-25 0:22 [PATCH v2 1/3] PM / sleep: Check legacy pm callbacks for direct complete Derek Basehore
2016-02-25 0:22 ` Derek Basehore [this message]
2016-02-28 1:31 ` [PATCH v2 2/3] PM / sleep: try to runtime suspend " Rafael J. Wysocki
2016-03-01 21:48 ` dbasehore .
2016-02-25 0:22 ` [PATCH v2 3/3] scsi: allow scsi devices to use " Derek Basehore
2016-02-27 7:26 ` Mika Westerberg
2016-02-27 8:10 ` dbasehore .
2016-02-27 8:38 ` Mika Westerberg
2016-02-27 9:07 ` dbasehore .
2016-02-29 10:10 ` Mika Westerberg
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=1456359748-22838-2-git-send-email-dbasehore@chromium.org \
--to=dbasehore@chromium.org \
--cc=gregkh@linuxfoundation.org \
--cc=len.brown@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=pavel@ucw.cz \
--cc=rjw@rjwysocki.net \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).