From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Mark Brown <broonie@kernel.org>
Cc: Liam Girdwood <lgirdwood@gmail.com>,
Guenter Roeck <linux@roeck-us.net>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] regulator: devres: introduce managed enable and disable operations
Date: Mon, 13 Feb 2017 10:51:52 -0800 [thread overview]
Message-ID: <20170213185152.GC20057@dtor-ws> (raw)
In-Reply-To: <20170213180129.wutjitdr72klhxwu@sirena.org.uk>
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
next prev parent reply other threads:[~2017-02-13 18:51 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-13 2:32 [PATCH v2] regulator: devres: introduce managed enable and disable operations Dmitry Torokhov
2017-02-13 18:01 ` Mark Brown
2017-02-13 18:51 ` Dmitry Torokhov [this message]
2017-02-20 19:02 ` Mark Brown
2017-02-21 8:30 ` Dmitry Torokhov
2017-02-21 18:56 ` Mark Brown
2017-02-23 7:25 ` Dmitry Torokhov
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=20170213185152.GC20057@dtor-ws \
--to=dmitry.torokhov@gmail.com \
--cc=broonie@kernel.org \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@roeck-us.net \
/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).