From: <gregkh@linuxfoundation.org>
To: javier@osg.samsung.com, broonie@kernel.org, gregkh@linuxfoundation.org
Cc: <stable@vger.kernel.org>, <stable-commits@vger.kernel.org>
Subject: Patch "regulator: Try to resolve regulators supplies on registration" has been added to the 4.4-stable tree
Date: Sat, 04 Jun 2016 12:18:56 -0700 [thread overview]
Message-ID: <1465067936156230@kroah.com> (raw)
This is a note to let you know that I've just added the patch titled
regulator: Try to resolve regulators supplies on registration
to the 4.4-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
regulator-try-to-resolve-regulators-supplies-on-registration.patch
and it can be found in the queue-4.4 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@vger.kernel.org> know about it.
>From 5e3ca2b349b1e2c80b060b51bbf2af37448fad85 Mon Sep 17 00:00:00 2001
From: Javier Martinez Canillas <javier@osg.samsung.com>
Date: Wed, 23 Mar 2016 20:59:34 -0300
Subject: regulator: Try to resolve regulators supplies on registration
From: Javier Martinez Canillas <javier@osg.samsung.com>
commit 5e3ca2b349b1e2c80b060b51bbf2af37448fad85 upstream.
Commit 6261b06de565 ("regulator: Defer lookup of supply to regulator_get")
moved the regulator supplies lookup logic from the regulators registration
to the regulators get time.
Unfortunately, that changed the behavior of the regulator core since now a
parent supply with a child regulator marked as always-on, won't be enabled
unless a client driver attempts to get the child regulator during boot.
This patch tries to resolve the parent supply for the already registered
regulators each time that a new regulator is registered. So the regulators
that have child regulators marked as always on will be enabled regardless
if a driver gets the child regulator or not.
That was the behavior before the mentioned commit, since parent supplies
were looked up at regulator registration time instead of during child get.
Since regulator_resolve_supply() checks for rdev->supply, most of the times
it will be a no-op. Errors aren't checked to keep the possible out of order
dependencies which was the motivation for the mentioned commit.
Also, the supply being available will be enforced on regulator get anyways
in case the resolve fails on regulators registration.
Fixes: 6261b06de565 ("regulator: Defer lookup of supply to regulator_get")
Suggested-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/regulator/core.c | 9 +++++++++
1 file changed, 9 insertions(+)
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -3826,6 +3826,11 @@ static void rdev_init_debugfs(struct reg
&rdev->bypass_count);
}
+static int regulator_register_resolve_supply(struct device *dev, void *data)
+{
+ return regulator_resolve_supply(dev_to_rdev(dev));
+}
+
/**
* regulator_register - register regulator
* @regulator_desc: regulator to register
@@ -3972,6 +3977,10 @@ regulator_register(const struct regulato
}
rdev_init_debugfs(rdev);
+
+ /* try to resolve regulators supply since a new one was registered */
+ class_for_each_device(®ulator_class, NULL, NULL,
+ regulator_register_resolve_supply);
out:
mutex_unlock(®ulator_list_mutex);
kfree(config);
Patches currently in stable-queue which might be from javier@osg.samsung.com are
queue-4.4/regulator-try-to-resolve-regulators-supplies-on-registration.patch
reply other threads:[~2016-06-04 19:18 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=1465067936156230@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=broonie@kernel.org \
--cc=javier@osg.samsung.com \
--cc=stable-commits@vger.kernel.org \
--cc=stable@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 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.