Thread (16 messages) flat view 16 messages, 6 authors, 2012-09-13
STALE5073d

[PATCH] ARM: smp_twd: reprogram twd based on clk notifier

From: Ulf Hansson <hidden>
Date: 2012-09-10 11:22:17

On 7 September 2012 23:59, Mike Turquette [off-list ref] wrote:
Quoting Ulf Hansson (2012-09-07 06:26:21)
quoted
On 7 September 2012 14:40, Shawn Guo [off-list ref] wrote:
quoted
On Fri, Sep 07, 2012 at 01:59:40PM +0200, Ulf Hansson wrote:
quoted
Hi Shawn and Mike,

In general I am in favor of this patch, but I also see some
corresponding problems to resolve. Please correct me if I am wrong.

I suppose most machines is relying on that it enough to only take care
of the notification by using "cpufreq_notify_transition" from their
cpufreq drivers. Thus those have to make sure the updates for smp_twd
clock is supported from within the cpufreq driver I suppose.

In other words the cpufreq drivers needs to do clk_get of "smp_twd"
clock and then do a set_rate on it when it's has changed, to trigger a
rate change notification. Is this what you also have in mind or do you
have any other idea of how this should work?
Here is how it works on imx6q.

1) There are clks arm and twd defined in imx6q clock tree.  And twd
   is registered to clock framework as one child of arm clk with a fixed
   divider 2.

        /*                                    name         parent_name     mult div */
        clk[twd]       = imx_clk_fixed_factor("twd",       "arm",            1, 2);

2) Register lookup "cpu0" and "smp_twd" for cpufreq and smp_twd drivers
   respectively.

        clk_register_clkdev(clk[twd], NULL, "smp_twd");
        clk_register_clkdev(clk[arm], NULL, "cpu0");

That's it.  The clock framework will just handle all the work nicely.
When cpufreq driver scales arm clk, the framework will propagate the
rate change to twd clk automatically.  And once twd clk rate changes,
smp_twd will get the notification.
That's a nice solution!
This won't work for ux500 that simple though. Maybe I might be able to
use some kind of clock "parent" thing though, let's see. Thanks for
the information!
Hi Ulf,

Why won't this work for ux500?
The value for smp_twd clock freq is not directly connected to the CPU
freq clock, I believe. I will dig into the details to see what we can
do to make the most easiest solution.
Using a "parent" solution is definitely to prefer, so let's see.

Kind regards
Ulf Hansson
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help