* [PATCH] ARM: twd: Adjust localtimer frequency with cpufreq notifiers
@ 2010-11-18 6:14 Colin Cross
2011-03-04 10:17 ` Linus Walleij
0 siblings, 1 reply; 7+ messages in thread
From: Colin Cross @ 2010-11-18 6:14 UTC (permalink / raw)
To: linux-arm-kernel
The clock to the ARM TWD local timer scales with the cpu
frequency. To allow the cpu frequency to change while
maintaining a constant TWD frequency, pick a lower target
frequency for the TWD and use the prescaler to divide down
to the closest lower frequency.
This patch provides a new initialization function that takes
a target TWD frequency and the ratio between the cpu
clock and the TWD clock, specified as an integer divider >= 2
in the Cortex A9 MPCore TRM, and 2 in the ARM11 MPCore TRM.
It also registers a cpufreq notifier that adjusts the
prescaler when the cpu frequency changes.
Signed-off-by: Colin Cross <ccross@android.com>
---
arch/arm/include/asm/smp_twd.h | 11 ++++
arch/arm/kernel/smp_twd.c | 106 +++++++++++++++++++++++++++++++++++++---
2 files changed, 109 insertions(+), 8 deletions(-)
diff --git a/arch/arm/include/asm/smp_twd.h b/arch/arm/include/asm/smp_twd.h
index 634f357..5119763 100644
--- a/arch/arm/include/asm/smp_twd.h
+++ b/arch/arm/include/asm/smp_twd.h
@@ -17,6 +17,7 @@
#define TWD_TIMER_CONTROL_ONESHOT (0 << 1)
#define TWD_TIMER_CONTROL_PERIODIC (1 << 1)
#define TWD_TIMER_CONTROL_IT_ENABLE (1 << 2)
+#define TWD_TIMER_CONTROL_PRESCALE_MASK (0xFF << 8)
struct clock_event_device;
@@ -26,4 +27,14 @@ void twd_timer_stop(void);
int twd_timer_ack(void);
void twd_timer_setup(struct clock_event_device *);
+/*
+ * Use this setup function on systems that support cpufreq.
+ * periphclk_prescaler is the fixed divider value between the cpu
+ * clock and the PERIPHCLK clock that feeds the TWD. target_rate should be
+ * low enough that the prescaler can accurately reach the target rate from the
+ * lowest cpu frequency, but high enough to give a reasonable timer accuracy.
+ */
+void twd_timer_setup_scalable(struct clock_event_device *,
+ unsigned long target_rate, unsigned int periphclk_prescaler);
+
#endif
diff --git a/arch/arm/kernel/smp_twd.c b/arch/arm/kernel/smp_twd.c
index 35882fb..e2bc65c 100644
--- a/arch/arm/kernel/smp_twd.c
+++ b/arch/arm/kernel/smp_twd.c
@@ -17,6 +17,7 @@
#include <linux/clockchips.h>
#include <linux/irq.h>
#include <linux/io.h>
+#include <linux/cpufreq.h>
#include <asm/smp_twd.h>
#include <asm/hardware/gic.h>
@@ -25,11 +26,17 @@
void __iomem *twd_base;
static unsigned long twd_timer_rate;
+static unsigned long twd_periphclk_prescaler;
+static unsigned long twd_target_rate;
static void twd_set_mode(enum clock_event_mode mode,
struct clock_event_device *clk)
{
unsigned long ctrl;
+ unsigned long prescale;
+
+ prescale = __raw_readl(twd_base + TWD_TIMER_CONTROL) &
+ TWD_TIMER_CONTROL_PRESCALE_MASK;
switch (mode) {
case CLOCK_EVT_MODE_PERIODIC:
@@ -47,6 +54,8 @@ static void twd_set_mode(enum clock_event_mode mode,
ctrl = 0;
}
+ ctrl |= prescale;
+
__raw_writel(ctrl, twd_base + TWD_TIMER_CONTROL);
}
@@ -79,9 +88,55 @@ int twd_timer_ack(void)
return 0;
}
+/*
+ * must be called with interrupts disabled and on the cpu that is being changed
+ */
+static void twd_update_cpu_frequency(unsigned long new_rate)
+{
+ u32 ctrl;
+ int prescaler;
+
+ BUG_ON(twd_periphclk_prescaler == 0 || twd_target_rate == 0);
+
+ twd_timer_rate = new_rate / twd_periphclk_prescaler;
+
+ prescaler = DIV_ROUND_UP(twd_timer_rate, twd_target_rate);
+ prescaler = clamp(prescaler - 1, 0, 0xFF);
+
+ ctrl = __raw_readl(twd_base + TWD_TIMER_CONTROL);
+ ctrl &= ~TWD_TIMER_CONTROL_PRESCALE_MASK;
+ ctrl |= prescaler << 8;
+ __raw_writel(ctrl, twd_base + TWD_TIMER_CONTROL);
+}
+
+static void twd_update_cpu_frequency_on_cpu(void *data)
+{
+ struct cpufreq_freqs *freq = data;
+
+ twd_update_cpu_frequency(freq->new * 1000);
+}
+
+static int twd_cpufreq_notifier(struct notifier_block *nb,
+ unsigned long event, void *data)
+{
+ struct cpufreq_freqs *freq = data;
+
+ if (event == CPUFREQ_RESUMECHANGE ||
+ (event == CPUFREQ_PRECHANGE && freq->new > freq->old) ||
+ (event == CPUFREQ_POSTCHANGE && freq->new < freq->old))
+ smp_call_function_single(freq->cpu,
+ twd_update_cpu_frequency_on_cpu, freq, 1);
+
+ return 0;
+}
+
+static struct notifier_block twd_cpufreq_notifier_block = {
+ .notifier_call = twd_cpufreq_notifier,
+};
+
static void __cpuinit twd_calibrate_rate(void)
{
- unsigned long load, count;
+ unsigned long count;
u64 waitjiffies;
/*
@@ -114,23 +169,37 @@ static void __cpuinit twd_calibrate_rate(void)
twd_timer_rate = (0xFFFFFFFFU - count) * (HZ / 5);
printk("%lu.%02luMHz.\n", twd_timer_rate / 1000000,
- (twd_timer_rate / 100000) % 100);
+ (twd_timer_rate / 10000) % 100);
}
-
- load = twd_timer_rate / HZ;
-
- __raw_writel(load, twd_base + TWD_TIMER_LOAD);
}
/*
* Setup the local clock events for a CPU.
*/
-void __cpuinit twd_timer_setup(struct clock_event_device *clk)
+static void __cpuinit __twd_timer_setup(struct clock_event_device *clk,
+ unsigned long target_rate, unsigned int periphclk_prescaler)
{
unsigned long flags;
+ unsigned long load;
+ unsigned long cpu_rate;
+ unsigned long twd_tick_rate;
twd_calibrate_rate();
+ if (target_rate && periphclk_prescaler) {
+ cpu_rate = twd_timer_rate * periphclk_prescaler;
+ twd_target_rate = target_rate;
+ twd_periphclk_prescaler = periphclk_prescaler;
+ twd_update_cpu_frequency(cpu_rate);
+ twd_tick_rate = twd_target_rate;
+ } else {
+ twd_tick_rate = twd_timer_rate;
+ }
+
+ load = twd_tick_rate / HZ;
+
+ __raw_writel(load, twd_base + TWD_TIMER_LOAD);
+
clk->name = "local_timer";
clk->features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT |
CLOCK_EVT_FEAT_C3STOP;
@@ -138,7 +207,7 @@ void __cpuinit twd_timer_setup(struct clock_event_device *clk)
clk->set_mode = twd_set_mode;
clk->set_next_event = twd_set_next_event;
clk->shift = 20;
- clk->mult = div_sc(twd_timer_rate, NSEC_PER_SEC, clk->shift);
+ clk->mult = div_sc(twd_tick_rate, NSEC_PER_SEC, clk->shift);
clk->max_delta_ns = clockevent_delta2ns(0xffffffff, clk);
clk->min_delta_ns = clockevent_delta2ns(0xf, clk);
@@ -151,6 +220,27 @@ void __cpuinit twd_timer_setup(struct clock_event_device *clk)
clockevents_register_device(clk);
}
+void __cpuinit twd_timer_setup_scalable(struct clock_event_device *clk,
+ unsigned long target_rate, unsigned int periphclk_prescaler)
+{
+ __twd_timer_setup(clk, target_rate, periphclk_prescaler);
+}
+
+void __cpuinit twd_timer_setup(struct clock_event_device *clk)
+{
+ __twd_timer_setup(clk, 0, 0);
+}
+
+static int twd_timer_setup_cpufreq(void)
+{
+ if (twd_periphclk_prescaler)
+ cpufreq_register_notifier(&twd_cpufreq_notifier_block,
+ CPUFREQ_TRANSITION_NOTIFIER);
+
+ return 0;
+}
+arch_initcall(twd_timer_setup_cpufreq);
+
#ifdef CONFIG_HOTPLUG_CPU
/*
* take a local timer down
--
1.7.3.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH] ARM: twd: Adjust localtimer frequency with cpufreq notifiers
@ 2010-11-18 6:47 Colin Cross
0 siblings, 0 replies; 7+ messages in thread
From: Colin Cross @ 2010-11-18 6:47 UTC (permalink / raw)
To: linux-arm-kernel
The clock to the ARM TWD local timer scales with the cpu
frequency. To allow the cpu frequency to change while
maintaining a constant TWD frequency, pick a lower target
frequency for the TWD and use the prescaler to divide down
to the closest lower frequency.
This patch provides a new initialization function that takes
a target TWD frequency and the ratio between the cpu
clock and the TWD clock, specified as an integer divider >= 2
in the Cortex A9 MPCore TRM, and 2 in the ARM11 MPCore TRM.
It also registers a cpufreq notifier that adjusts the
prescaler when the cpu frequency changes.
Signed-off-by: Colin Cross <ccross@android.com>
---
arch/arm/include/asm/smp_twd.h | 11 ++++
arch/arm/kernel/smp_twd.c | 106 +++++++++++++++++++++++++++++++++++++---
2 files changed, 109 insertions(+), 8 deletions(-)
diff --git a/arch/arm/include/asm/smp_twd.h b/arch/arm/include/asm/smp_twd.h
index 634f357..5119763 100644
--- a/arch/arm/include/asm/smp_twd.h
+++ b/arch/arm/include/asm/smp_twd.h
@@ -17,6 +17,7 @@
#define TWD_TIMER_CONTROL_ONESHOT (0 << 1)
#define TWD_TIMER_CONTROL_PERIODIC (1 << 1)
#define TWD_TIMER_CONTROL_IT_ENABLE (1 << 2)
+#define TWD_TIMER_CONTROL_PRESCALE_MASK (0xFF << 8)
struct clock_event_device;
@@ -26,4 +27,14 @@ void twd_timer_stop(void);
int twd_timer_ack(void);
void twd_timer_setup(struct clock_event_device *);
+/*
+ * Use this setup function on systems that support cpufreq.
+ * periphclk_prescaler is the fixed divider value between the cpu
+ * clock and the PERIPHCLK clock that feeds the TWD. target_rate should be
+ * low enough that the prescaler can accurately reach the target rate from the
+ * lowest cpu frequency, but high enough to give a reasonable timer accuracy.
+ */
+void twd_timer_setup_scalable(struct clock_event_device *,
+ unsigned long target_rate, unsigned int periphclk_prescaler);
+
#endif
diff --git a/arch/arm/kernel/smp_twd.c b/arch/arm/kernel/smp_twd.c
index 35882fb..e2bc65c 100644
--- a/arch/arm/kernel/smp_twd.c
+++ b/arch/arm/kernel/smp_twd.c
@@ -17,6 +17,7 @@
#include <linux/clockchips.h>
#include <linux/irq.h>
#include <linux/io.h>
+#include <linux/cpufreq.h>
#include <asm/smp_twd.h>
#include <asm/hardware/gic.h>
@@ -25,11 +26,17 @@
void __iomem *twd_base;
static unsigned long twd_timer_rate;
+static unsigned long twd_periphclk_prescaler;
+static unsigned long twd_target_rate;
static void twd_set_mode(enum clock_event_mode mode,
struct clock_event_device *clk)
{
unsigned long ctrl;
+ unsigned long prescale;
+
+ prescale = __raw_readl(twd_base + TWD_TIMER_CONTROL) &
+ TWD_TIMER_CONTROL_PRESCALE_MASK;
switch (mode) {
case CLOCK_EVT_MODE_PERIODIC:
@@ -47,6 +54,8 @@ static void twd_set_mode(enum clock_event_mode mode,
ctrl = 0;
}
+ ctrl |= prescale;
+
__raw_writel(ctrl, twd_base + TWD_TIMER_CONTROL);
}
@@ -79,9 +88,55 @@ int twd_timer_ack(void)
return 0;
}
+/*
+ * must be called with interrupts disabled and on the cpu that is being changed
+ */
+static void twd_update_cpu_frequency(unsigned long new_rate)
+{
+ u32 ctrl;
+ int prescaler;
+
+ BUG_ON(twd_periphclk_prescaler == 0 || twd_target_rate == 0);
+
+ twd_timer_rate = new_rate / twd_periphclk_prescaler;
+
+ prescaler = DIV_ROUND_UP(twd_timer_rate, twd_target_rate);
+ prescaler = clamp(prescaler - 1, 0, 0xFF);
+
+ ctrl = __raw_readl(twd_base + TWD_TIMER_CONTROL);
+ ctrl &= ~TWD_TIMER_CONTROL_PRESCALE_MASK;
+ ctrl |= prescaler << 8;
+ __raw_writel(ctrl, twd_base + TWD_TIMER_CONTROL);
+}
+
+static void twd_update_cpu_frequency_on_cpu(void *data)
+{
+ struct cpufreq_freqs *freq = data;
+
+ twd_update_cpu_frequency(freq->new * 1000);
+}
+
+static int twd_cpufreq_notifier(struct notifier_block *nb,
+ unsigned long event, void *data)
+{
+ struct cpufreq_freqs *freq = data;
+
+ if (event == CPUFREQ_RESUMECHANGE ||
+ (event == CPUFREQ_PRECHANGE && freq->new > freq->old) ||
+ (event == CPUFREQ_POSTCHANGE && freq->new < freq->old))
+ smp_call_function_single(freq->cpu,
+ twd_update_cpu_frequency_on_cpu, freq, 1);
+
+ return 0;
+}
+
+static struct notifier_block twd_cpufreq_notifier_block = {
+ .notifier_call = twd_cpufreq_notifier,
+};
+
static void __cpuinit twd_calibrate_rate(void)
{
- unsigned long load, count;
+ unsigned long count;
u64 waitjiffies;
/*
@@ -114,23 +169,37 @@ static void __cpuinit twd_calibrate_rate(void)
twd_timer_rate = (0xFFFFFFFFU - count) * (HZ / 5);
printk("%lu.%02luMHz.\n", twd_timer_rate / 1000000,
- (twd_timer_rate / 100000) % 100);
+ (twd_timer_rate / 10000) % 100);
}
-
- load = twd_timer_rate / HZ;
-
- __raw_writel(load, twd_base + TWD_TIMER_LOAD);
}
/*
* Setup the local clock events for a CPU.
*/
-void __cpuinit twd_timer_setup(struct clock_event_device *clk)
+static void __cpuinit __twd_timer_setup(struct clock_event_device *clk,
+ unsigned long target_rate, unsigned int periphclk_prescaler)
{
unsigned long flags;
+ unsigned long load;
+ unsigned long cpu_rate;
+ unsigned long twd_tick_rate;
twd_calibrate_rate();
+ if (target_rate && periphclk_prescaler) {
+ cpu_rate = twd_timer_rate * periphclk_prescaler;
+ twd_target_rate = target_rate;
+ twd_periphclk_prescaler = periphclk_prescaler;
+ twd_update_cpu_frequency(cpu_rate);
+ twd_tick_rate = twd_target_rate;
+ } else {
+ twd_tick_rate = twd_timer_rate;
+ }
+
+ load = twd_tick_rate / HZ;
+
+ __raw_writel(load, twd_base + TWD_TIMER_LOAD);
+
clk->name = "local_timer";
clk->features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT |
CLOCK_EVT_FEAT_C3STOP;
@@ -138,7 +207,7 @@ void __cpuinit twd_timer_setup(struct clock_event_device *clk)
clk->set_mode = twd_set_mode;
clk->set_next_event = twd_set_next_event;
clk->shift = 20;
- clk->mult = div_sc(twd_timer_rate, NSEC_PER_SEC, clk->shift);
+ clk->mult = div_sc(twd_tick_rate, NSEC_PER_SEC, clk->shift);
clk->max_delta_ns = clockevent_delta2ns(0xffffffff, clk);
clk->min_delta_ns = clockevent_delta2ns(0xf, clk);
@@ -151,6 +220,27 @@ void __cpuinit twd_timer_setup(struct clock_event_device *clk)
clockevents_register_device(clk);
}
+void __cpuinit twd_timer_setup_scalable(struct clock_event_device *clk,
+ unsigned long target_rate, unsigned int periphclk_prescaler)
+{
+ __twd_timer_setup(clk, target_rate, periphclk_prescaler);
+}
+
+void __cpuinit twd_timer_setup(struct clock_event_device *clk)
+{
+ __twd_timer_setup(clk, 0, 0);
+}
+
+static int twd_timer_setup_cpufreq(void)
+{
+ if (twd_periphclk_prescaler)
+ cpufreq_register_notifier(&twd_cpufreq_notifier_block,
+ CPUFREQ_TRANSITION_NOTIFIER);
+
+ return 0;
+}
+arch_initcall(twd_timer_setup_cpufreq);
+
#ifdef CONFIG_HOTPLUG_CPU
/*
* take a local timer down
--
1.7.3.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH] ARM: twd: Adjust localtimer frequency with cpufreq notifiers
2010-11-18 6:14 Colin Cross
@ 2011-03-04 10:17 ` Linus Walleij
2011-03-04 10:27 ` martin persson
0 siblings, 1 reply; 7+ messages in thread
From: Linus Walleij @ 2011-03-04 10:17 UTC (permalink / raw)
To: linux-arm-kernel
2010/11/18 Colin Cross <ccross@android.com>:
> The clock to the ARM TWD local timer scales with the cpu
> frequency. To allow the cpu frequency to change while
> maintaining a constant TWD frequency, pick a lower target
> frequency for the TWD and use the prescaler to divide down
> to the closest lower frequency.
We are using this with some custom hooks for the U8500.
Tested-by: Linus Walleij <linus.walleij@linaro.org>
Martin Persson can probably provide an additional Tested-by
from ST-Ericsson if it helps.
Colin are you merging this patch for 2.6.39 through
Russells tracker or pull request? It's an important patch
for us.
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH] ARM: twd: Adjust localtimer frequency with cpufreq notifiers
2011-03-04 10:17 ` Linus Walleij
@ 2011-03-04 10:27 ` martin persson
2011-03-04 20:11 ` Colin Cross
0 siblings, 1 reply; 7+ messages in thread
From: martin persson @ 2011-03-04 10:27 UTC (permalink / raw)
To: linux-arm-kernel
We've seen no problems using this patch and have been grateful for it's existence. So I'm happy to put:
Tested-by: martin.persson at stericsson.com
/Martin
On 03/04/2011 11:17 AM, Linus Walleij wrote:
> 2010/11/18 Colin Cross<ccross@android.com>:
>
>> The clock to the ARM TWD local timer scales with the cpu
>> frequency. To allow the cpu frequency to change while
>> maintaining a constant TWD frequency, pick a lower target
>> frequency for the TWD and use the prescaler to divide down
>> to the closest lower frequency.
> We are using this with some custom hooks for the U8500.
>
> Tested-by: Linus Walleij<linus.walleij@linaro.org>
>
> Martin Persson can probably provide an additional Tested-by
> from ST-Ericsson if it helps.
>
> Colin are you merging this patch for 2.6.39 through
> Russells tracker or pull request? It's an important patch
> for us.
>
> Yours,
> Linus Walleij
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH] ARM: twd: Adjust localtimer frequency with cpufreq notifiers
2011-03-04 10:27 ` martin persson
@ 2011-03-04 20:11 ` Colin Cross
2011-03-04 20:31 ` Rob Herring
0 siblings, 1 reply; 7+ messages in thread
From: Colin Cross @ 2011-03-04 20:11 UTC (permalink / raw)
To: linux-arm-kernel
On Fri, Mar 4, 2011 at 2:27 AM, martin persson
<martin.persson@stericsson.com> wrote:
> We've seen no problems using this patch and have been grateful for it's
> existence. So I'm happy to put:
>
> Tested-by: martin.persson at stericsson.com
>
> /Martin
>
> On 03/04/2011 11:17 AM, Linus Walleij wrote:
>>
>> 2010/11/18 Colin Cross<ccross@android.com>:
>>
>>> The clock to the ARM TWD local timer scales with the cpu
>>> frequency. To allow the cpu frequency to change while
>>> maintaining a constant TWD frequency, pick a lower target
>>> frequency for the TWD and use the prescaler to divide down
>>> to the closest lower frequency.
>>
>> We are using this with some custom hooks for the U8500.
>>
>> Tested-by: Linus Walleij<linus.walleij@linaro.org>
>>
>> Martin Persson can probably provide an additional Tested-by
>> from ST-Ericsson if it helps.
>>
>> Colin are you merging this patch for 2.6.39 through
>> Russells tracker or pull request? It's an important patch
>> for us.
>>
>> Yours,
>> Linus Walleij
>
I never got any responses, and it conflicts with Rob Herring's patch
6434/1, although that has not been applied. Russell, do you want this
in the patch tracker?
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH] ARM: twd: Adjust localtimer frequency with cpufreq notifiers
2011-03-04 20:11 ` Colin Cross
@ 2011-03-04 20:31 ` Rob Herring
2011-03-04 21:33 ` Colin Cross
0 siblings, 1 reply; 7+ messages in thread
From: Rob Herring @ 2011-03-04 20:31 UTC (permalink / raw)
To: linux-arm-kernel
On 03/04/2011 02:11 PM, Colin Cross wrote:
> On Fri, Mar 4, 2011 at 2:27 AM, martin persson
> <martin.persson@stericsson.com> wrote:
>> We've seen no problems using this patch and have been grateful for it's
>> existence. So I'm happy to put:
>>
>> Tested-by: martin.persson at stericsson.com
>>
>> /Martin
>>
>> On 03/04/2011 11:17 AM, Linus Walleij wrote:
>>>
>>> 2010/11/18 Colin Cross<ccross@android.com>:
>>>
>>>> The clock to the ARM TWD local timer scales with the cpu
>>>> frequency. To allow the cpu frequency to change while
>>>> maintaining a constant TWD frequency, pick a lower target
>>>> frequency for the TWD and use the prescaler to divide down
>>>> to the closest lower frequency.
>>>
>>> We are using this with some custom hooks for the U8500.
>>>
>>> Tested-by: Linus Walleij<linus.walleij@linaro.org>
>>>
>>> Martin Persson can probably provide an additional Tested-by
>>> from ST-Ericsson if it helps.
>>>
>>> Colin are you merging this patch for 2.6.39 through
>>> Russells tracker or pull request? It's an important patch
>>> for us.
>>>
>>> Yours,
>>> Linus Walleij
>>
>
> I never got any responses, and it conflicts with Rob Herring's patch
> 6434/1, although that has not been applied. Russell, do you want this
> in the patch tracker?
Russell wanted to move over completely to using the clock api rather
than making clock api usage optional and this was dependent on his
init_early changes for Realview/Versatile. So I need to update the
patches based on that.
I think a cleaner solution for this is platforms should define a clock
for the local timer and the notifier can just get the clock rate again.
But these clocks have to be implemented first on all platforms using
local timer to make it unconditional, and I don't have the clock tree
knowledge of all those platforms.
Rob
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH] ARM: twd: Adjust localtimer frequency with cpufreq notifiers
2011-03-04 20:31 ` Rob Herring
@ 2011-03-04 21:33 ` Colin Cross
0 siblings, 0 replies; 7+ messages in thread
From: Colin Cross @ 2011-03-04 21:33 UTC (permalink / raw)
To: linux-arm-kernel
On Fri, Mar 4, 2011 at 12:31 PM, Rob Herring <robherring2@gmail.com> wrote:
> On 03/04/2011 02:11 PM, Colin Cross wrote:
>>
>> On Fri, Mar 4, 2011 at 2:27 AM, martin persson
>> <martin.persson@stericsson.com> ?wrote:
>>>
>>> We've seen no problems using this patch and have been grateful for it's
>>> existence. So I'm happy to put:
>>>
>>> Tested-by: martin.persson at stericsson.com
>>>
>>> /Martin
>>>
>>> On 03/04/2011 11:17 AM, Linus Walleij wrote:
>>>>
>>>> 2010/11/18 Colin Cross<ccross@android.com>:
>>>>
>>>>> The clock to the ARM TWD local timer scales with the cpu
>>>>> frequency. To allow the cpu frequency to change while
>>>>> maintaining a constant TWD frequency, pick a lower target
>>>>> frequency for the TWD and use the prescaler to divide down
>>>>> to the closest lower frequency.
>>>>
>>>> We are using this with some custom hooks for the U8500.
>>>>
>>>> Tested-by: Linus Walleij<linus.walleij@linaro.org>
>>>>
>>>> Martin Persson can probably provide an additional Tested-by
>>>> from ST-Ericsson if it helps.
>>>>
>>>> Colin are you merging this patch for 2.6.39 through
>>>> Russells tracker or pull request? It's an important patch
>>>> for us.
>>>>
>>>> Yours,
>>>> Linus Walleij
>>>
>>
>> I never got any responses, and it conflicts with Rob Herring's patch
>> 6434/1, although that has not been applied. ?Russell, do you want this
>> in the patch tracker?
>
> Russell wanted to move over completely to using the clock api rather than
> making clock api usage optional and this was dependent on his init_early
> changes for Realview/Versatile. So I need to update the patches based on
> that.
>
> I think a cleaner solution for this is platforms should define a clock for
> the local timer and the notifier can just get the clock rate again. But
> these clocks have to be implemented first on all platforms using local timer
> to make it unconditional, and I don't have the clock tree knowledge of all
> those platforms.
>
> Rob
>
Using a clock along with the cpufreq notifiers would simplify my patch
some. Maybe we can use the traction this patch has among platforms
that use the twd to get the necessary clocks added. Can you post a
version of your patch that assumes the presence of a twd clock, and
I'll work on getting the necessary clocks added and updating my patch
on top of yours?
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2011-03-04 21:33 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-11-18 6:47 [PATCH] ARM: twd: Adjust localtimer frequency with cpufreq notifiers Colin Cross
-- strict thread matches above, loose matches on Subject: below --
2010-11-18 6:14 Colin Cross
2011-03-04 10:17 ` Linus Walleij
2011-03-04 10:27 ` martin persson
2011-03-04 20:11 ` Colin Cross
2011-03-04 20:31 ` Rob Herring
2011-03-04 21:33 ` Colin Cross
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).