From: viresh.kumar@st.com (Viresh Kumar)
To: linux-arm-kernel@lists.infradead.org
Subject: [Query] Common Clock Framework: How to handle clks enabled by default
Date: Tue, 17 Apr 2012 12:55:25 +0530 [thread overview]
Message-ID: <4F8D1AE5.9000509@st.com> (raw)
In-Reply-To: <CAAQ0ZWT_xJAp4H_k_Mr24Fcj5tKAhpev4nr8gpK3-3zpM_MobA@mail.gmail.com>
On 4/17/2012 12:43 PM, Shawn Guo wrote:
> On 17 April 2012 14:21, Viresh Kumar <viresh.kumar@st.com> wrote:
>> Hi,
>>
>> How are we handling clocks which are enabled by bootloaders and are
>> required to be enabled, like, pll, cpu, ahb?
>>
> Call clk_prepare_enable on the clocks in platform clock init function.
Probably that is what i need.
>> Following is example clk hierarchy:
>> osc(root)->pll->cpu->ahb->dma
>>
>> Issue1: Now, when we do clk_enable() for dma, all these already enabled clocks
>> are re-enabled.
>
> What's the problem with doing that? Your hardware does not cope with
> setting/clearing a bit that already set/cleared. Even if that is the
> case, you can easily handle that in your .enable/.disable ops.
No issues with my hardware atleast, but seems to be logically incorrect.
If we could have scanned hardware at boot time, to see which are enabled
by bootloader and updated clk_prepare/enable count for them in clk framework,
picture would have been much clearer.
We can disable clks (enabled by bootloader), that lacks a specific flag in
their flags field during this scan.
>> Issue2: On clk_disable() all are disabled and system hangs :(
>>
> It should not. It means you have other clocks in the hierarchy not
> manged well. The parent of the clock will not be gated by calling
> clk_disable, if there are other sibling clocks are enabled.
Yes. This happens at boot time, where clk_enable for none of the siblings
is called.
>> There is one option CLK_IGNORE_UNUSED, which is used only for disabling
>> unused clocks. So that is not helpful here.
>>
>> One way i could think of is not to give clk_gate support for these clocks,
>> so that they can never be disabled. Is this the preferred way?
>>
> It only makes sense on those completely internal clocks which will
> never need managing.
Hmm.
--
viresh
prev parent reply other threads:[~2012-04-17 7:25 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-04-17 6:21 [Query] Common Clock Framework: How to handle clks enabled by default Viresh Kumar
2012-04-17 7:13 ` Shawn Guo
2012-04-17 7:25 ` Viresh Kumar [this message]
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=4F8D1AE5.9000509@st.com \
--to=viresh.kumar@st.com \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.