stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Torsten Duwe <duwe@lst.de>
To: Mark Brown <broonie@kernel.org>
Cc: Liam Girdwood <lgirdwood@gmail.com>,
	linux-kernel@vger.kernel.org, stable@vger.kernel.org
Subject: Re: [PATCH] regulator: Defer init completion for a while after late_initcall
Date: Mon, 18 Nov 2019 20:40:12 +0100	[thread overview]
Message-ID: <20191118194012.GB7894@lst.de> (raw)
In-Reply-To: <20191118165651.GK9761@sirena.org.uk>

On Mon, Nov 18, 2019 at 04:56:51PM +0000, Mark Brown wrote:
> On Mon, Nov 18, 2019 at 05:41:01PM +0100, Torsten Duwe wrote:
> > On Mon, Nov 18, 2019 at 12:46:54PM +0000, Mark Brown wrote:
> 
> > > This is not new behaviour, all this change did was delay this.  We've
> > > been powering off unused regulators for a bit over a decade.
> 
> > For me, this appeared first after upgrading from from 5.3.0-rc1 to 5.4.0-rc6.
> > I guess the late initcall was executed before the regulator driver module got
> > loaded? And now, with the 30s delay, the regulator driver is finally there?
> > Would that explain it?
> 
> If the regulator driver wasn't loaded you'd not see the power off on
> late init, yes.

Then this is the change I see, thanks for the confirmation.

> 
> Regulators are enabled using the regulator_enable() call,

Fine, the driver does that, but...

> I don't follow at all, if a driver is calling regulator_get() and
> regulator_put() repeatedly at runtime around voltage changes then it
> sounds like the driver is extremely broken.  Further, if a supply has a
> regulator provided in device tree then a dummy regulator will never be
> provided for it.  

I'm afraid I must object here:

kernel: anx6345 0-0038: 0-0038 supply dvdd12-supply not found, using dummy regulator
kernel: anx6345 0-0038: 0-0038 supply dvdd25-supply not found, using dummy regulator

DT has:
  dvdd25-supply = <&reg_dldo2>;
  dvdd12-supply = <&reg_dldo3>;

It's only that the regulator driver module has not fully loaded at that point.

> > AFAICS the caller is then stuck with a reference to the dummy, correct?
> 
> If a dummy regulator has been provided then there is no possibility that
> a real supply could be provided, there's not a firmware description of
> one.  We use a dummy regulator to keep software working on the basis
> that it's unlikely that the device can operate without power but lacking
> any information on the regulator we can't actually control it.

That's what I figured. I was fancying some hash table for yet unkown
regulators with callbacks to those who had asked. Or the EPROBE_DEFER
to have them come back later. Maybe initrd barriers would help.

So is my understanding correct that with the above messages, the anx6345
driver will never be able to control those voltages for real?
And additionally, the real regulator's use count will remain 0 unless there
are other users (which there aren't)?

Again: this all didn't matter before this init completion code was moved
to the right location. Power management wouldn't work, but at least the
established voltages stayed on.

	Torsten


  reply	other threads:[~2019-11-18 19:40 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20190904124250.25844-1-broonie@kernel.org>
2019-09-04 17:53 ` Applied "regulator: Defer init completion for a while after late_initcall" to the regulator tree Mark Brown
2019-11-16 12:52 ` [PATCH] regulator: Defer init completion for a while after late_initcall Torsten Duwe
2019-11-18 12:46   ` Mark Brown
2019-11-18 16:41     ` Torsten Duwe
2019-11-18 16:56       ` Mark Brown
2019-11-18 19:40         ` Torsten Duwe [this message]
2019-11-18 20:29           ` Mark Brown
2019-11-30 15:27             ` Torsten Duwe
2019-12-01 23:49               ` 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=20191118194012.GB7894@lst.de \
    --to=duwe@lst.de \
    --cc=broonie@kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).