lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAD=FV=XM0i=GsvttJjug6VPOJJGHRqFmsmCp-1XXNvmsYp9sJA@mail.gmail.com>
Date:   Tue, 1 Oct 2019 12:57:31 -0700
From:   Doug Anderson <dianders@...omium.org>
To:     Marco Felsch <m.felsch@...gutronix.de>
Cc:     Mark Brown <broonie@...nel.org>,
        Chunyan Zhang <zhang.chunyan@...aro.org>,
        Liam Girdwood <lgirdwood@...il.com>,
        ckeepax@...nsource.cirrus.com, LKML <linux-kernel@...r.kernel.org>,
        Sascha Hauer <kernel@...gutronix.de>
Subject: Re: [PATCH 1/3] regulator: core: fix boot-on regulators use_count usage

Hi,

On Fri, Sep 27, 2019 at 1:47 AM Marco Felsch <m.felsch@...gutronix.de> wrote:
> > > > > 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?

I don't think your fix is correct.  It sounds as if the intention of
"regulator-boot-on" is to have the OS turn the regulator on at bootup
and it keep an implicit reference until someone explicitly tells the
OS to drop the reference.


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

It's a fixed regulator controlled by a GPIO?  Presumably the GPIO can
be read.  That would mean it ideally shouldn't be using
"regulator-boot-on" since this is _not_ a regulator whose software
state can't be read.  Just remove the property.


-Doug

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ