From: james.hogan@imgtec•com (James Hogan)
To: linux-arm-kernel@lists•infradead.org
Subject: [PATCH v3 2/4] clk: add support for clock reparent on set_rate
Date: Mon, 20 May 2013 10:13:11 +0100 [thread overview]
Message-ID: <5199E927.3080500@imgtec.com> (raw)
In-Reply-To: <20130520041508.GA27676@codeaurora.org>
On 20/05/13 05:15, Stephen Boyd wrote:
> Noticed another minor thing. I'm working on the set rate and
> parent at the same time op on top of this patch series. Hopefully
> have something soon.
>
> On 05/15, James Hogan wrote:
>> @@ -1181,6 +1242,11 @@ static void clk_change_rate(struct clk *clk)
>>
>> old_rate = clk->rate;
>>
>> + /* set parent */
>> + if (clk->new_parent && clk->new_parent != clk->parent)
>> + __clk_set_parent_no_recalc(clk, clk->new_parent,
>> + clk->new_parent_index);
>> +
>
> This check here for new_parent != clk->parent ...
>
>> @@ -1451,6 +1501,27 @@ static int __clk_set_parent(struct clk *clk, struct clk *parent, u8 p_index)
>> return 0;
>> }
>>
>> +static int __clk_set_parent_no_recalc(struct clk *clk, struct clk *parent,
>> + u8 p_index)
>> +{
>> + int ret = 0;
>> +
>> + if (clk->parent == parent)
>> + goto out;
>
> causes this to never be true, so we can probably drop it.
>
>> +
>> + /* only re-parent if the clock is not in use */
>> + ret = __clk_set_parent(clk, parent, p_index);
>> + if (ret)
>> + goto out;
>> +
>> + /* reparent, but don't propagate rate recalculation downstream */
>> + clk_reparent(clk, parent);
>> + clk_debug_reparent(clk, parent);
>> +
>> +out:
>> + return ret;
>> +}
>
> Also, we never check the return code so it's sort of useless.
>
Hi Stephen,
Well spotted, and as you pointed it privately it can use
__clk_set_parent() instead of __clk_set_parent_no_recalc() now :)
Thanks
James
next prev parent reply other threads:[~2013-05-20 9:13 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-15 13:40 [PATCH v3 0/4] clk: implement remuxing during set_rate James Hogan
2013-05-15 13:41 ` [PATCH v3 1/4] clk: abstract parent cache James Hogan
2013-05-15 20:25 ` Stephen Boyd
2013-05-15 13:41 ` [PATCH v3 2/4] clk: add support for clock reparent on set_rate James Hogan
2013-05-15 20:25 ` Stephen Boyd
2013-05-16 9:35 ` James Hogan
2013-05-20 4:15 ` Stephen Boyd
2013-05-20 9:13 ` James Hogan [this message]
2013-05-15 13:41 ` [PATCH v3 3/4] clk: add CLK_SET_RATE_NO_REPARENT flag James Hogan
2013-05-15 13:41 ` [PATCH v3 4/4] clk: clk-mux: implement remuxing on set_rate 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=5199E927.3080500@imgtec.com \
--to=james.hogan@imgtec$(echo .)com \
--cc=linux-arm-kernel@lists$(echo .)infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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