From: Mark Brown <broonie@kernel.org>
To: WEN Pingbo <pingbo.wen@linaro.org>
Cc: linux-kernel@vger.kernel.org, lgirdwood@gmail.com,
vincent.guittot@linaro.org, stephen.boyd@linaro.org
Subject: Re: [RFC PATCH 2/2] regulator: add boot protection flag
Date: Sun, 24 Apr 2016 23:51:27 +0100 [thread overview]
Message-ID: <20160424225127.GI3217@sirena.org.uk> (raw)
In-Reply-To: <1461395466-14896-2-git-send-email-pingbo.wen@linaro.org>
[-- Attachment #1: Type: text/plain, Size: 2323 bytes --]
On Sat, Apr 23, 2016 at 03:11:06PM +0800, WEN Pingbo wrote:
> This patch try to add a boot_protection flag in regulator constraints.
> So the regulator core will prevent the specified operation during kernel
> booting.
> The boot_protection flag only work before late_initicall. And as other
> constraints liked, you can specify this flag in a board file, or in
> dts file. By default, all operations of this regulator will be rejected
> during kernel booting, if you add this flag in a regulator. But you
> still have a chance to change this, by modifying boot_valid_ops_mask.
This is still a complete hack which is going to break as soon as things
are built modular, it's definitely *not* something that should ever
appear in DT since it depends so heavily on implementation details. If
you need some driver to start early work on getting that sorted.
This is also going to interact badly with any other drivers that are
trying to configure things at runtime, if they've done enables and
disables (or especially an enable without a matching disable) their
refcounts are going to be wrong and if they've tried to do anything with
setting voltages we'll have completely ignored whatever they asked for
or told them that they can't change voltages. If we were doing anything
like this it would need to be a lot more transparent to other
regulators sharing the supplies (which are presumably what's causing
problems here).
> [ This patch depends on regulator_ops_is_valid patch. And some document
> need to add, but I want to hear some voice first. ]
There is no need to say that patch 2 in a series depends on patch 1.
> @@ -868,7 +877,7 @@ static void print_constraints(struct regulator_dev *rdev)
> rdev_dbg(rdev, "%s\n", buf);
>
> if ((constraints->min_uV != constraints->max_uV) &&
> - !regulator_ops_is_valid(rdev, REGULATOR_CHANGE_VOLTAGE))
> + !(constraints->valid_ops_mask & REGULATOR_CHANGE_VOLTAGE))
> rdev_warn(rdev,
> "Voltage range but no REGULATOR_CHANGE_VOLTAGE\n");
> }
This appears to be unrelated?
> + if (constraints->boot_protection) {
> + if (of_property_read_bool(np, "boot-allow-set-voltage"))
> + constraints->boot_valid_ops_mask |=
> + REGULATOR_CHANGE_VOLTAGE;
We were factoring things out a minute ago...
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 473 bytes --]
next prev parent reply other threads:[~2016-04-24 22:51 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-23 7:11 [RFC PATCH 1/2] regulator: refactor valid_ops_mask checking code WEN Pingbo
2016-04-23 7:11 ` [RFC PATCH 2/2] regulator: add boot protection flag WEN Pingbo
2016-04-24 22:51 ` Mark Brown [this message]
2016-04-26 11:46 ` Pingbo Wen
2016-04-26 16:36 ` Mark Brown
2016-04-25 17:56 ` Applied "regulator: refactor valid_ops_mask checking code" to the regulator tree 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=20160424225127.GI3217@sirena.org.uk \
--to=broonie@kernel.org \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=pingbo.wen@linaro.org \
--cc=stephen.boyd@linaro.org \
--cc=vincent.guittot@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®