Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1579997

Re: [PATCH v2] regulator: devres: introduce managed enable and disable operations

From Dmitry Torokhov <dmitry.torokhov@gmail.com>
Newsgroups linux.kernel
Subject Re: [PATCH v2] regulator: devres: introduce managed enable and disable operations
Date 2017-02-13 20:00 +0100
Message-ID <tau0W-7vg-9@gated-at.bofh.it> (permalink)
References <taeIx-5Qx-5@gated-at.bofh.it> <tatey-7cr-15@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Mon, Feb 13, 2017 at 06:01:29PM +0000, Mark Brown wrote:
> On Sun, Feb 12, 2017 at 06:32:49PM -0800, Dmitry Torokhov wrote:
> 
> > v2: restored lost regulator_disable() stub
> 
> > Mark, note that there is also patch introducing devm_clk_prepare() and
> > devm_clk_prepare_enable() that Russell did not hate so I think it will
> > get applied eventually. I believe lack of CLK methods was cited as a
> > reason for not having managed enable for regulators.
> 
> No, that's never been an issue.  The concern is partly that nobody
> bothered writing the patch but also that it gets messy over suspend and
> resume since you end up with drivers either doing explicit releases of
> managed resources (which is not normally a good pattern) or mixing
> managed and unmanaged access to the same resource which is also fun.  

I see where you are coming from, but I think that it is lesser concern
than mixing managed and unmanaged resources in probe() and remove() and
making sure that release order is right when they are mixed like that.

I think it is helps if you think about devm_regulator_enable and regular
regulator_enable as managed and unmanaged *actions*, not resources. So
managed action of enabling regulator will be undone on remove() and you
have to manually undo unmanaged regulator_disable() on resume(). It is
not worse than having unbalanced regulator_enable/disable between
probe()/suspend()/resume()/remove().

Thanks.

-- 
Dmitry

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v2] regulator: devres: introduce managed enable and disable  operations Dmitry Torokhov <dmitry.torokhov@gmail.com> - 2017-02-13 03:40 +0100
  Re: [PATCH v2] regulator: devres: introduce managed enable and  disable operations Mark Brown <broonie@kernel.org> - 2017-02-13 19:10 +0100
    Re: [PATCH v2] regulator: devres: introduce managed enable and  disable operations Dmitry Torokhov <dmitry.torokhov@gmail.com> - 2017-02-13 20:00 +0100
      Re: [PATCH v2] regulator: devres: introduce managed enable and  disable operations Mark Brown <broonie@kernel.org> - 2017-02-20 20:10 +0100
        Re: [PATCH v2] regulator: devres: introduce managed enable and  disable operations Dmitry Torokhov <dmitry.torokhov@gmail.com> - 2017-02-21 09:40 +0100
          Re: [PATCH v2] regulator: devres: introduce managed enable and  disable operations Mark Brown <broonie@kernel.org> - 2017-02-21 20:10 +0100
            Re: [PATCH v2] regulator: devres: introduce managed enable and  disable operations Dmitry Torokhov <dmitry.torokhov@gmail.com> - 2017-02-23 08:30 +0100

csiph-web