From: Grygorii Strashko <grygorii.strashko@ti.com>
To: "Rafael J. Wysocki" <rjw@rjwysocki.net>,
<linux-pm@vger.kernel.org>, Len Brown <len.brown@intel.com>,
Pavel Machek <pavel@ucw.cz>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Kevin Hilman <khilman@kernel.org>,
Ulf Hansson <ulf.hansson@linaro.org>,
<linux-kernel@vger.kernel.org>,
Grygorii Strashko <grygorii.strashko@ti.com>
Subject: [PATCH] PM / sleep: fix unbalanced pm runtime disable in __device_suspend_late()
Date: Fri, 13 May 2016 21:03:48 +0300 [thread overview]
Message-ID: <1463162628-16976-1-git-send-email-grygorii.strashko@ti.com> (raw)
The PM runtime will be left disabled for the device if its .suspend_late()
callback fails and async suspend is not allowed for this device. In
this case device will not be added in dpm_late_early_list and
dpm_resume_early() will ignore this device, as result PM runtime will
be disabled for it forever (side effect: after 8 subsequent failures
for the same device the PM runtime will be reenabled due to
disable_depth overflow).
Hence, re-enable PM runtime in __device_suspend_late() if
.suspend_late() callback fails and async suspend is not allowed for
this device.
Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
---
drivers/base/power/main.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/drivers/base/power/main.c b/drivers/base/power/main.c
index 6e7c3cc..9b266e5 100644
--- a/drivers/base/power/main.c
+++ b/drivers/base/power/main.c
@@ -1207,10 +1207,13 @@ static int __device_suspend_late(struct device *dev, pm_message_t state, bool as
}
error = dpm_run_callback(callback, dev, state, info);
- if (!error)
+ if (!error) {
dev->power.is_late_suspended = true;
- else
+ } else {
async_error = error;
+ if (!is_async(dev))
+ pm_runtime_enable(dev);
+ }
Complete:
TRACE_SUSPEND(error);
--
2.8.2
next reply other threads:[~2016-05-13 18:04 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-13 18:03 Grygorii Strashko [this message]
2016-05-19 13:38 ` Rafael J. Wysocki
2016-05-19 17:11 ` Grygorii Strashko
2016-05-20 12:18 ` Rafael J. Wysocki
2016-05-20 16:21 ` Grygorii Strashko
2016-05-20 21:26 ` Rafael J. Wysocki
2016-05-23 15:06 ` Grygorii Strashko
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=1463162628-16976-1-git-send-email-grygorii.strashko@ti.com \
--to=grygorii.strashko@ti.com \
--cc=gregkh@linuxfoundation.org \
--cc=khilman@kernel.org \
--cc=len.brown@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=pavel@ucw.cz \
--cc=rjw@rjwysocki.net \
--cc=ulf.hansson@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®