From: skannan@codeaurora.org (Saravana Kannan)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 0/3] clk: implement remuxing during set_rate
Date: Wed, 15 May 2013 21:11:43 -0700 [thread overview]
Message-ID: <51945C7F.2030605@codeaurora.org> (raw)
In-Reply-To: <1366388904-13903-1-git-send-email-james.hogan@imgtec.com>
On 04/19/2013 09:28 AM, James Hogan wrote:
> 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.
>
> 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(-)
>
I really want to review this because I solved the same problem in our
internal clock framework and want to make sure upstream doesn't go
through the same mistakes. But haven't had the time. Hopefully, I'll go
it before this gets accepted by Mike. I'll try to do it this week/weekend.
Thanks,
Saravana
--
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
hosted by The Linux Foundation
next prev parent reply other threads:[~2013-05-16 4:11 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
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 [this message]
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=51945C7F.2030605@codeaurora.org \
--to=skannan@codeaurora.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).