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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAASAkoY=pgTE6nVKeoSDVsSEBU2zgckRuE-m4G+7L9-_Q2yUnw@mail.gmail.com>
Date:   Tue, 29 Jun 2021 10:55:49 +0300
From:   Alexandru Ardelean <aardelean@...iqon.com>
To:     Mark Brown <broonie@...nel.org>
Cc:     Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        lgirdwood@...il.com, Dmitry Torokhov <dmitry.torokhov@...il.com>,
        Guenter Roeck <linux@...ck-us.net>
Subject: Re: [RFC PATCH] regulator: devres: disable regulator on release if
 refcount is 1

On Mon, 28 Jun 2021 at 17:53, Mark Brown <broonie@...nel.org> wrote:
>
> On Fri, Jun 25, 2021 at 03:53:07PM +0300, Alexandru Ardelean wrote:
>
> > This means that the last 'regulator_disable()' (on driver remove) becomes
> > optional.
> > If there are any unbalanced regulator_enable()/regulator_disable() calls,
> > the 'enable_count' won't be touched and 'regulator_put()' will print a
> > warning.
>
> This doesn't seem like it's going to make reviewing and debugging
> reference counting issues any easier, it seems even more of a concern
> than a devm version TBH.  It's also not clear why if we were doing this
> we'd restrict it to a single reference.

Yeah, it doesn't make much difference if the refcount is 1 or higher.
For any refcount higher than 1, it's a serious unbalance of reg enable
+ disable.
And I agree that this may complicate reviews, as this would be one
extra subtlety [in the regulator framework] to account for.

Will send an RFC v2 with the short-hand.
I'm not trying to force anything with this, but looking at all the
repetitiveness of the devm_add_action_or_reset() hook to disable
simple regulators, I thought I'd [also] propose a variant or another.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ