Re: [PATCH 1/3] regulator: core: fix boot-on regulators use_count usage
From: Marco Felsch
Date: Fri Sep 27 2019 - 04:47:19 EST
Hi Doug, Mark,
sorry for the delay..
On 19-09-26 12:44, Doug Anderson wrote:
> Hi,
>
> On Tue, Sep 24, 2019 at 11:28 AM Mark Brown <broonie@xxxxxxxxxx> wrote:
> > On Mon, Sep 23, 2019 at 03:40:09PM -0700, Doug Anderson wrote:
> > > On Mon, Sep 23, 2019 at 11:49 AM Mark Brown <broonie@xxxxxxxxxx> wrote:
> > > > On Mon, Sep 23, 2019 at 11:36:11AM -0700, Doug Anderson wrote:
> >
> > > > > 1. Would it be valid to say that it's always incorrect to set this
> > > > > property if there is a way to read the status back from the regulator?
> >
> > > > As originally intended, yes. I'm now not 100% sure that it won't
> > > > break any existing systems though :/
> >
> > > Should I change the bindings doc to say that?
> >
> > Sure.
>
> Sent ("regulator: Document "regulator-boot-on" binding more thoroughly").
>
> 20190926124115.1.Ice34ad5970a375c3c03cb15c3859b3ee501561bf@changeid">https://lore.kernel.org/r/20190926124115.1.Ice34ad5970a375c3c03cb15c3859b3ee501561bf@changeid
Yes, I saw it and thanks for it =)
> > > > It should be possible to do a regulator_disable() though I'm not
> > > > sure anyone actually uses that. The pattern for a regular
> > > > consumer should be the normal enable/disable pair to handle
> > > > shared usage, only an exclusive consumer should be able to use
> > > > just a straight disable.
In my case it is a regulator-fixed which uses the enable/disable pair.
But as my descriptions says this will not work currently because boot-on
marked regulators can't be disabled right now (using the same logic as
always-on regulators).
> > > Ah, I see, I wasn't aware of the "exclusive" special case! Marco: is
> > > this working for you? I wonder if we need to match
> > > "regulator->enable_count" to "rdev->use_count" at the end of
> > > _regulator_get() in the exclusive case...
So my fix isn't correct to fix this in general?
> > Yes, I think that case has been missed when adding the enable
> > counts - I've never actually had a system myself that made any
> > use of this stuff. It probably needs an audit of the users to
> > make sure nobody's relying on the current behaviour though I
> > can't think how they would.
>
> Marco: I'm going to assume you'll tackle this since I don't actually
> have any use cases that need this.
My use case is a simple regulator-fixed which is turned on by the
bootloader or to be more precise by the pmic-rom. To map that correctly
I marked this regulator as boot-on. Unfortunately as I pointed out above
this is handeld the same way as always-on.
Regards,
Marco
> -Doug
>
--
Pengutronix e.K. | |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |