From: Dmitry Torokhov <email@example.com>
To: Guenter Roeck <firstname.lastname@example.org>
Cc: Stephen Boyd <email@example.com>,
Russell King - ARM Linux <firstname.lastname@example.org>,
Michael Turquette <email@example.com>,
Viresh Kumar <firstname.lastname@example.org>,
Andy Shevchenko <email@example.com>,
Subject: Re: [PATCH v2] clk: add more managed APIs
Date: Mon, 30 Jan 2017 16:59:57 -0800 [thread overview]
Message-ID: <20170131005957.GB35974@dtor-ws> (raw)
On Mon, Jan 30, 2017 at 11:22:14AM -0800, Guenter Roeck wrote:
> On Mon, Jan 30, 2017 at 10:55:51AM -0800, Stephen Boyd wrote:
> > On 01/29, Dmitry Torokhov wrote:
> > > When converting a driver to managed resources it is desirable to be able to
> > > manage all resources in the same fashion. This change allows managing
> > > clocks in the same way we manage many other resources.
> > Can you please add 'managing clock prepared and enabled state in
> > the same way'?
> > The current wording makes it sound like we don't have
> > devm_clk_get() when we do.
> > >
> > > This adds the following managed APIs:
> > >
> > > - devm_clk_prepare()/devm_clk_unprepare();
> > > - devm_clk_prepare_enable()/devm_clk_disable_unprepare().
> > Wouldn't this be preceded by a devm_clk_get() call? Wouldn't it
> > be even shorter to have the APIs
> > devm_clk_get_and_prepare()/devm_clk_unprepare_and_put()
> > devm_clk_get_and_prepare_enable()/devm_clk_disable_unprepare_and_put()
> > instead?
> In many cases I see
> Sometimes the calls are intertwined with setting the clock rates.
> clk_set_rate(clk, rate);
> Maybe the additional calls make sense; I can imagine they would.
> However, I personally would be a bit wary of changing the initialization
> order of multi-clock initializations, and I am not sure how a single call
> could address setting the rate ([devm_]clk_get_setrate_prepare_enable()
> seems like a bit too much).
> [ On a side note, why is there no clk_get_prepare_enable() and
> clk_get_prepare() ? Maybe it would be better to introduce those
> together with the matching devm_ functions in a separate patch
> if they are useful. ]
> > Is there any other subsystem that has similar functionality?
> > Regulators? GPIOs? Resets? I'm just curious if those subsystems
> > also need similar changes.
> Ultimately yes, and most already do. If I recall correctly, I tried to
> introduce devm_ functions for regulators some time ago, but that was
> rejected with the comment that it would invite misuse. At the time
> I accepted that; today my reaction would be to counter that pretty much
> everything can be misused, and that the potential for misuse should not
> penaltize all the valid use cases.
I think we should ping Mark again. The only thing we are achieving is
that everyone is using devm_add_action_or_reset() with wrappers around
As I said elsewhere, there are "always used" devices where it isn't
worth it to postpone enabling regulators.
next prev parent reply other threads:[~2017-01-31 1:02 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-28 18:40 [PATCH] " Dmitry Torokhov
2017-01-28 19:03 ` Russell King - ARM Linux
2017-01-28 19:22 ` Dmitry Torokhov
2017-01-28 21:44 ` Guenter Roeck
2017-01-28 23:39 ` Russell King - ARM Linux
2017-01-29 16:00 ` Guenter Roeck
2017-01-29 18:07 ` [PATCH v2] " Dmitry Torokhov
2017-01-29 18:31 ` Guenter Roeck
2017-01-30 18:55 ` Stephen Boyd
2017-01-30 19:22 ` Guenter Roeck
2017-01-30 21:42 ` Russell King - ARM Linux
2017-01-30 21:58 ` Dmitry Torokhov
2017-01-30 22:25 ` Russell King - ARM Linux
2017-01-30 22:51 ` Guenter Roeck
2017-01-31 8:43 ` Geert Uytterhoeven
2017-01-31 0:59 ` Dmitry Torokhov [this message]
2017-01-31 17:20 ` Guenter Roeck
2017-01-31 18:26 ` Dmitry Torokhov
2017-01-31 19:34 ` Guenter Roeck
2017-01-31 0:57 ` [PATCH v3] " Dmitry Torokhov
2017-02-07 3:51 ` Dmitry Torokhov
2017-02-14 19:44 ` Stephen Boyd
2017-02-14 19:55 ` Dmitry Torokhov
2017-02-14 20:31 ` Guenter Roeck
2017-02-14 20:01 ` Russell King - ARM Linux
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:
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--subject='Re: [PATCH v2] clk: add more managed APIs' \
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
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).