From: mturquette@linaro.org (Mike Turquette)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 0/3] clk: implement remuxing during set_rate
Date: Mon, 13 May 2013 12:57:46 -0700 [thread overview]
Message-ID: <20130513195746.10068.92303@quantum> (raw)
In-Reply-To: <1366388904-13903-1-git-send-email-james.hogan@imgtec.com>
Quoting James Hogan (2013-04-19 09:28:21)
> This patchset adds support for automatic selection of the best parent
> for a clock mux, i.e. the one which can provide the closest clock rate
> to that requested. It can be controlled by a new CLK_SET_RATE_REMUX flag
> so that it doesn't happen unless explicitly allowed.
>
I'm not sure about the new flag. One of my regrets during the early
development of the common struct clk is the CLK_SET_RATE_PARENT flag.
In hindsight I would have preferred to make parent-propagation of rate
changes the default behavior, and instead provide a flag to prevent that
behavior, such as CLK_SET_RATE_NO_PROPAGATE.
One reason for this is the difficulty some have had with setting flags
from DT bindings. Another reason is that a core goal of the framework
is to remove topology info from drivers; having to set a flag explicitly
on each clock to propagate rate changes is an impediment to that goal.
So perhaps CLK_SET_RATE_REMUX is a similar situation. What do you think
about making remuxing the default and providing a flag to prevent it?
And also we can assume for the immediate future that users of
.determine_rate WANT to remux, since .round_rate won't do it. Though
eventually it might be wise to convert all users of .round_rate over to
.determine_rate and deprecate .round_rate entirely.
Regards,
Mike
> This works by way of adding a new op, determine_rate, similar to
> round_rate but with an extra parameter to allow the clock driver to
> optionally select a different parent clock. This is used in
> clk_calc_new_rates to decide whether to initiate a set_parent operation.
>
> Changes in v2:
>
> I've moved the mux determine_rate implementation into a core helper, but
> I haven't pushed it fully into the core, as I think it just wouldn't
> work correctly for more complex clocks, e.g. if you (theoretically) had
> a combined mux and divide, you'd want to intercept the determine_rate
> and ask for a larger rate from the parent clocks, then return the
> divided rate. This should be possible by wrapping the mux determine_rate
> helper.
>
> Patch 1 still exports the __clk_get_parent_by_index as it seems like it
> might be a useful thing for clock implementations to have access to if
> they ever wanted to do something more fancy with changing clock parents.
>
> I haven't made any attempt to implement the atomic set_parent+set_rate
> as I don't have hardware that could take proper advantage of it, but it
> shouldn't be too difficult for others to implement if they wanted since
> they're fairly close to one another (in clk_change_rate()).
>
> * switched to using new determine_rate op rather than adding an argument
> to round_rate.
> * moved mux implementation into a single helper which should be usable
> from more complex clocks which can mux.
> * rewrite main implementation so that no changes are made until after
> the PRE notifications have been sent, and in a way that should ensure
> correct notifications without duplicates, and I think should be safe
> in the event of a notification failing.
> * various tidy ups and fixes.
>
> James Hogan (3):
> clk: abstract parent cache
> clk: add support for clock reparent on set_rate
> clk: clk-mux: implement remuxing on set_rate
>
> Documentation/clk.txt | 4 +
> drivers/clk/clk-mux.c | 1 +
> drivers/clk/clk.c | 216 +++++++++++++++++++++++++++++++++----------
> include/linux/clk-private.h | 2 +
> include/linux/clk-provider.h | 12 +++
> 5 files changed, 185 insertions(+), 50 deletions(-)
>
> --
> 1.8.1.2
next prev parent reply other threads:[~2013-05-13 19:57 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-19 16:28 [PATCH v2 0/3] clk: implement remuxing during set_rate James Hogan
2013-04-19 16:28 ` [PATCH v2 1/3] clk: abstract parent cache James Hogan
2013-05-13 20:01 ` Mike Turquette
2013-04-19 16:28 ` [PATCH v2 2/3] clk: add support for clock reparent on set_rate James Hogan
2013-05-09 20:01 ` Stephen Boyd
2013-05-10 10:41 ` James Hogan
2013-05-14 18:13 ` Mike Turquette
2013-05-14 20:35 ` James Hogan
2013-04-19 16:28 ` [PATCH v2 3/3] clk: clk-mux: implement remuxing " James Hogan
2013-05-08 23:36 ` [PATCH v2 0/3] clk: implement remuxing during set_rate Stephen Boyd
2013-05-09 3:50 ` Saravana Kannan
2013-05-09 9:02 ` James Hogan
2013-05-09 19:48 ` Stephen Boyd
2013-05-10 10:43 ` James Hogan
2013-05-13 19:57 ` Mike Turquette [this message]
2013-05-13 21:30 ` James Hogan
2013-05-14 16:59 ` Mike Turquette
2013-05-14 21:01 ` James Hogan
2013-05-14 22:15 ` Mike Turquette
2013-05-16 4:11 ` Saravana Kannan
2013-05-16 9:25 ` James Hogan
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=20130513195746.10068.92303@quantum \
--to=mturquette@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
/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).