mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Mark Brown <broonie@kernel.org>
To: Pingbo Wen <pingbo.wen@linaro.org>
Cc: linux-kernel@vger.kernel.org, lgirdwood@gmail.com,
	Vincent Guittot <vincent.guittot@linaro.org>,
	stephen.boyd@linaro.org
Subject: Re: [RFC PATCH 2/2] regulator: add boot protection flag
Date: Tue, 26 Apr 2016 17:36:25 +0100	[thread overview]
Message-ID: <20160426163625.GB3217@sirena.org.uk> (raw)
In-Reply-To: <5D111CFC-F2DD-4372-B66F-9F2E90877A03@linaro.org>

[-- Attachment #1: Type: text/plain, Size: 1840 bytes --]

On Tue, Apr 26, 2016 at 07:46:07PM +0800, Pingbo Wen wrote:

> > 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.

> I think this patch can handle the case you mentioned. I have add a
> regulator_has_booted flag, and it will set in regulator_init_complete()
> late_initcall hook. The regulator_ops_is_valid() will ignore boot
> protection if this flag is set.

That doesn't help after we get to userspace so doesn't work as soon as
things are built as modules.  That's a key issue with making something
that's robust here.

> > 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

> Ok, I have to admit that the boot_protection didn’t cover this. If other
> consumer try to configure during booting, it will get some error code.
> And the consumers need to re-configure the regulator state after
> late_initcall.

The worst thing is where we silently accept but forget about things
because the code currently translates them into valid noops then later
start paying attention to the operations, error codes at least the other
driver can handle.

> If we need to hold the state of other consumer, I prefer using a
> dummy-consumer to hold this. And this is my next try.

Or possibly store the data on the consumer but don't act on it then go
round actually acting on it when we decide to do things - that's more
what I'd have expected and seems like it might be easier than creating a
separate object.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

  reply	other threads:[~2016-04-26 16:36 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
2016-04-26 11:46     ` Pingbo Wen
2016-04-26 16:36       ` Mark Brown [this message]
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=20160426163625.GB3217@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®