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,
	Serge Broslavsky <serge.broslavsky@linaro.org>,
	Vincent Guittot <vincent.guittot@linaro.org>
Subject: Re: [RFC] shared regulator initialization and protection
Date: Mon, 18 Apr 2016 10:46:24 +0100	[thread overview]
Message-ID: <20160418094624.GM3217@sirena.org.uk> (raw)
In-Reply-To: <57148C0B.6080500@linaro.org>

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

On Mon, Apr 18, 2016 at 03:26:03PM +0800, Pingbo Wen wrote:
> On Tuesday, April 12, 2016 11:48 AM, Mark Brown wrote:
> > On Tue, Apr 12, 2016 at 10:44:11AM +0800, Pingbo Wen wrote:

> > What is the actual problem here?  Every driver is responsible for
> > ensuring that regulators are in a good state before it starts using the
> > hardware, if some other device did something before why do we care?

> Yes, I agree the driver should set the regulator before do the real work,
> when the device life time is started from driver probing. But if the device
> life time is started before Linux kernel loading, the regulator core should
> do the regulator initialization and protection to power the device properly,
> during kernel booting, until the consumer driver probed.

We can't guarantee that a consumer for a device will ever load in any
reasonable time.  There may be no driver, the driver may have hit some
other problem, the driver may not have been built or may have been built
but placed on inaccessible media.  It's fundamentally an unresolvable
problem outside of specific system integration, we have no way of
telling at what point to give up on something appearing.  The closest
we've got is initcalls but they are before modules get loaded so mean
things break as soon as they're built modular.

> > Anything based on doing things at initcall levels is fundamentally
> > broken, as soon as things are built modular like most things in a distro
> > kernel then it'll stop working.  If the system integrator needs some
> > devices to start early to provide continuity (the main case here is
> > display) they need to deal with that at the system integration level.

> Adding a initcall to do the consumer removing is not a decent method.
> We can do some hack in regulator_get(), removing agent consumer until
> specified device call regulator_get(), or the first regulator_get().

Then what happens if that driver never loads?  The other consumers are
stuck being unable to control the regulator indefinitely which isn't
great.

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

      reply	other threads:[~2016-04-18  9:46 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <5F710397-FBBA-40DE-B753-C03B9C7FF229@linaro.org>
2016-04-12  2:54 ` Pingbo Wen
2016-04-12  3:48 ` Mark Brown
2016-04-18  7:26   ` Pingbo Wen
2016-04-18  9:46     ` Mark Brown [this message]

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=20160418094624.GM3217@sirena.org.uk \
    --to=broonie@kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pingbo.wen@linaro.org \
    --cc=serge.broslavsky@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®