From: Javier Martinez Canillas <javier.martinez@collabora.co.uk>
To: Mark Brown <broonie@kernel.org>
Cc: Liam Girdwood <lgirdwood@gmail.com>,
Doug Anderson <dianders@chromium.org>,
linux-kernel@vger.kernel.org,
Javier Martinez Canillas <javier.martinez@collabora.co.uk>
Subject: [PATCH 1/1] regulator: Only enable disabled regulators on resume
Date: Mon, 2 Mar 2015 21:40:39 +0100 [thread overview]
Message-ID: <1425328839-28330-1-git-send-email-javier.martinez@collabora.co.uk> (raw)
After leaving from system wide suspend state, regulator_suspend_finish()
turn on regulators that may be turned off by regulator_suspend_prepare()
but it tries to enable all regulators that have an enable count > 0 or
that were marked as "always-on" regardless if those were disabled or not.
Trying to enable an already enabled regulator may cause issues so is
better to skip enabling regulators that were not disabled before suspend.
Signed-off-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk>
---
drivers/regulator/core.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index f2452148c8da..8551400d57e4 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -3816,9 +3816,11 @@ int regulator_suspend_finish(void)
list_for_each_entry(rdev, ®ulator_list, list) {
mutex_lock(&rdev->mutex);
if (rdev->use_count > 0 || rdev->constraints->always_on) {
- error = _regulator_do_enable(rdev);
- if (error)
- ret = error;
+ if (!_regulator_is_enabled(rdev)) {
+ error = _regulator_do_enable(rdev);
+ if (error)
+ ret = error;
+ }
} else {
if (!have_full_constraints())
goto unlock;
--
2.1.3
next reply other threads:[~2015-03-02 20:41 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-02 20:40 Javier Martinez Canillas [this message]
2015-03-03 17:24 ` Doug Anderson
2015-03-03 19:05 ` Javier Martinez Canillas
2015-03-04 13:45 ` Javier Martinez Canillas
2015-03-08 19:38 ` Mark Brown
2015-03-09 7:40 ` Javier Martinez Canillas
2015-03-11 10:57 ` Mark Brown
2015-03-11 11:00 ` Javier Martinez Canillas
2015-03-08 19:38 ` Mark Brown
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=1425328839-28330-1-git-send-email-javier.martinez@collabora.co.uk \
--to=javier.martinez@collabora.co.uk \
--cc=broonie@kernel.org \
--cc=dianders@chromium.org \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@vger.kernel.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®