* [PATCH 1/2] clocksource: nomadik-mtu: support timer-based delay
2012-12-04 10:10 [PATCH 0/2] clocksource: nomadik-mtu: support timer-based delay Fabio Baltieri
@ 2012-12-04 10:10 ` Fabio Baltieri
2012-12-04 10:10 ` [PATCH 2/2] cpufreq: db8500: set CPUFREQ_CONST_LOOPS Fabio Baltieri
2012-12-17 11:36 ` [PATCH 0/2] clocksource: nomadik-mtu: support timer-based delay Fabio Baltieri
2 siblings, 0 replies; 9+ messages in thread
From: Fabio Baltieri @ 2012-12-04 10:10 UTC (permalink / raw)
To: John Stultz, Arnd Bergmann, Thomas Gleixner, Rafael J. Wysocki
Cc: cpufreq, linux-pm, Linus Walleij, linux-arm-kernel, linux-kernel,
Fabio Baltieri
This patch adds support to use Nomadik MTU for timer-based delay.
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Fabio Baltieri <fabio.baltieri@linaro.org>
---
drivers/clocksource/nomadik-mtu.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/drivers/clocksource/nomadik-mtu.c b/drivers/clocksource/nomadik-mtu.c
index 8914c3c..5f3c8db 100644
--- a/drivers/clocksource/nomadik-mtu.c
+++ b/drivers/clocksource/nomadik-mtu.c
@@ -15,6 +15,7 @@
#include <linux/clocksource.h>
#include <linux/clk.h>
#include <linux/jiffies.h>
+#include <linux/delay.h>
#include <linux/err.h>
#include <linux/platform_data/clocksource-nomadik-mtu.h>
#include <asm/mach/time.h>
@@ -64,6 +65,7 @@ static void __iomem *mtu_base;
static bool clkevt_periodic;
static u32 clk_prescale;
static u32 nmdk_cycle; /* write-once */
+static struct delay_timer mtu_delay_timer;
#ifdef CONFIG_NOMADIK_MTU_SCHED_CLOCK
/*
@@ -80,6 +82,11 @@ static u32 notrace nomadik_read_sched_clock(void)
}
#endif
+static unsigned long nmdk_timer_read_current_timer(void)
+{
+ return ~readl_relaxed(mtu_base + MTU_VAL(0));
+}
+
/* Clockevent device: use one-shot mode */
static int nmdk_clkevt_next(unsigned long evt, struct clock_event_device *ev)
{
@@ -227,4 +234,8 @@ void __init nmdk_timer_init(void __iomem *base, int irq)
setup_irq(irq, &nmdk_timer_irq);
nmdk_clkevt.cpumask = cpumask_of(0);
clockevents_config_and_register(&nmdk_clkevt, rate, 2, 0xffffffffU);
+
+ mtu_delay_timer.read_current_timer = &nmdk_timer_read_current_timer;
+ mtu_delay_timer.freq = rate;
+ register_current_timer_delay(&mtu_delay_timer);
}
--
1.7.12.1
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH 2/2] cpufreq: db8500: set CPUFREQ_CONST_LOOPS
2012-12-04 10:10 [PATCH 0/2] clocksource: nomadik-mtu: support timer-based delay Fabio Baltieri
2012-12-04 10:10 ` [PATCH 1/2] " Fabio Baltieri
@ 2012-12-04 10:10 ` Fabio Baltieri
2012-12-17 18:24 ` Stephen Boyd
2012-12-17 11:36 ` [PATCH 0/2] clocksource: nomadik-mtu: support timer-based delay Fabio Baltieri
2 siblings, 1 reply; 9+ messages in thread
From: Fabio Baltieri @ 2012-12-04 10:10 UTC (permalink / raw)
To: John Stultz, Arnd Bergmann, Thomas Gleixner, Rafael J. Wysocki
Cc: cpufreq, linux-pm, Linus Walleij, linux-arm-kernel, linux-kernel,
Fabio Baltieri
As ux500 is being converted to timer based delay loops, and the timer
used is not depending on CPUs clock frequency, set cpufreq_driver flag
CPUFREQ_CONST_LOOPS to prevent cpufreq rescaling loops_for_jiffies.
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Fabio Baltieri <fabio.baltieri@linaro.org>
---
drivers/cpufreq/db8500-cpufreq.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/cpufreq/db8500-cpufreq.c b/drivers/cpufreq/db8500-cpufreq.c
index 74b830b..e758891 100644
--- a/drivers/cpufreq/db8500-cpufreq.c
+++ b/drivers/cpufreq/db8500-cpufreq.c
@@ -150,7 +150,7 @@ static int __cpuinit db8500_cpufreq_init(struct cpufreq_policy *policy)
}
static struct cpufreq_driver db8500_cpufreq_driver = {
- .flags = CPUFREQ_STICKY,
+ .flags = CPUFREQ_STICKY | CPUFREQ_CONST_LOOPS,
.verify = db8500_cpufreq_verify_speed,
.target = db8500_cpufreq_target,
.get = db8500_cpufreq_getspeed,
--
1.7.12.1
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH 2/2] cpufreq: db8500: set CPUFREQ_CONST_LOOPS
2012-12-04 10:10 ` [PATCH 2/2] cpufreq: db8500: set CPUFREQ_CONST_LOOPS Fabio Baltieri
@ 2012-12-17 18:24 ` Stephen Boyd
2012-12-17 22:03 ` Fabio Baltieri
0 siblings, 1 reply; 9+ messages in thread
From: Stephen Boyd @ 2012-12-17 18:24 UTC (permalink / raw)
To: Fabio Baltieri
Cc: John Stultz, Arnd Bergmann, Thomas Gleixner, Rafael J. Wysocki,
linux-pm, Linus Walleij, linux-kernel, cpufreq, linux-arm-kernel
On 12/04/12 02:10, Fabio Baltieri wrote:
> As ux500 is being converted to timer based delay loops, and the timer
> used is not depending on CPUs clock frequency, set cpufreq_driver flag
> CPUFREQ_CONST_LOOPS to prevent cpufreq rescaling loops_for_jiffies.
>
> Acked-by: Linus Walleij <linus.walleij@linaro.org>
> Signed-off-by: Fabio Baltieri <fabio.baltieri@linaro.org>
> ---
> drivers/cpufreq/db8500-cpufreq.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/cpufreq/db8500-cpufreq.c b/drivers/cpufreq/db8500-cpufreq.c
> index 74b830b..e758891 100644
> --- a/drivers/cpufreq/db8500-cpufreq.c
> +++ b/drivers/cpufreq/db8500-cpufreq.c
> @@ -150,7 +150,7 @@ static int __cpuinit db8500_cpufreq_init(struct cpufreq_policy *policy)
> }
>
> static struct cpufreq_driver db8500_cpufreq_driver = {
> - .flags = CPUFREQ_STICKY,
> + .flags = CPUFREQ_STICKY | CPUFREQ_CONST_LOOPS,
> .verify = db8500_cpufreq_verify_speed,
> .target = db8500_cpufreq_target,
> .get = db8500_cpufreq_getspeed,
Wouldn't you want to fold this into the previous patch so bisection is
not broken? Otherwise you have a place where lpj is all screwed up when
cpufreq mucks with it.
--
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
hosted by The Linux Foundation
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 2/2] cpufreq: db8500: set CPUFREQ_CONST_LOOPS
2012-12-17 18:24 ` Stephen Boyd
@ 2012-12-17 22:03 ` Fabio Baltieri
0 siblings, 0 replies; 9+ messages in thread
From: Fabio Baltieri @ 2012-12-17 22:03 UTC (permalink / raw)
To: Stephen Boyd
Cc: John Stultz, Arnd Bergmann, Thomas Gleixner, Rafael J. Wysocki,
linux-pm, Linus Walleij, linux-kernel, cpufreq, linux-arm-kernel
On Mon, Dec 17, 2012 at 10:24:15AM -0800, Stephen Boyd wrote:
> On 12/04/12 02:10, Fabio Baltieri wrote:
> > static struct cpufreq_driver db8500_cpufreq_driver = {
> > - .flags = CPUFREQ_STICKY,
> > + .flags = CPUFREQ_STICKY | CPUFREQ_CONST_LOOPS,
>
> Wouldn't you want to fold this into the previous patch so bisection is
> not broken? Otherwise you have a place where lpj is all screwed up when
> cpufreq mucks with it.
You are basically right... but that's not going to be as screwed up as
it's now, so I'd say that it's not worth the rebase unless the
maintainer says so. :-)
Thanks!
Fabio
--
Fabio Baltieri
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 0/2] clocksource: nomadik-mtu: support timer-based delay
2012-12-04 10:10 [PATCH 0/2] clocksource: nomadik-mtu: support timer-based delay Fabio Baltieri
2012-12-04 10:10 ` [PATCH 1/2] " Fabio Baltieri
2012-12-04 10:10 ` [PATCH 2/2] cpufreq: db8500: set CPUFREQ_CONST_LOOPS Fabio Baltieri
@ 2012-12-17 11:36 ` Fabio Baltieri
2012-12-17 18:38 ` Linus Walleij
2 siblings, 1 reply; 9+ messages in thread
From: Fabio Baltieri @ 2012-12-17 11:36 UTC (permalink / raw)
To: John Stultz, Arnd Bergmann, Thomas Gleixner
Cc: Rafael J. Wysocki, cpufreq, linux-pm, Linus Walleij,
linux-arm-kernel, linux-kernel
Hi all,
On Tue, Dec 04, 2012 at 11:10:43AM +0100, Fabio Baltieri wrote:
> this implements timer-based delay support for nomadik and ux500
> platforms, using the MTU as time source, and marks the u8500 cpufreq
> driver as CPUFREQ_CONST_LOOPS accordingly.
>
> The patches are based on Arnd's arm-soc/ux500/mtu-clk branch, as that
> contains latest MTU driver developments, including a driver move/rename,
> but I can rebase if necessary.
The patches applies cleanly on current mainline now, as all dependencies
has already been merged, can this be considered for for merging too?
Also, the nomadik-mtu driver has been moved into drivers/clocksource so
do anybody knows if this this should end up into arm-soc or in the
clocksource tree?
Thanks,
Fabio
> Fabio Baltieri (2):
> clocksource: nomadik-mtu: support timer-based delay
> cpufreq: db8500: set CPUFREQ_CONST_LOOPS
>
> drivers/clocksource/nomadik-mtu.c | 11 +++++++++++
> drivers/cpufreq/db8500-cpufreq.c | 2 +-
> 2 files changed, 12 insertions(+), 1 deletion(-)
--
Fabio Baltieri
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 0/2] clocksource: nomadik-mtu: support timer-based delay
2012-12-17 11:36 ` [PATCH 0/2] clocksource: nomadik-mtu: support timer-based delay Fabio Baltieri
@ 2012-12-17 18:38 ` Linus Walleij
2012-12-17 18:59 ` John Stultz
0 siblings, 1 reply; 9+ messages in thread
From: Linus Walleij @ 2012-12-17 18:38 UTC (permalink / raw)
To: Fabio Baltieri, John Stultz, Arnd Bergmann, Thomas Gleixner,
Rafael J. Wysocki, cpufreq, linux-pm, Linus Walleij,
linux-arm-kernel, linux-kernel
On Mon, Dec 17, 2012 at 12:36 PM, Fabio Baltieri
<fabio.baltieri@linaro.org> wrote:
> On Tue, Dec 04, 2012 at 11:10:43AM +0100, Fabio Baltieri wrote:
>> this implements timer-based delay support for nomadik and ux500
>> platforms, using the MTU as time source, and marks the u8500 cpufreq
>> driver as CPUFREQ_CONST_LOOPS accordingly.
>>
>> The patches are based on Arnd's arm-soc/ux500/mtu-clk branch, as that
>> contains latest MTU driver developments, including a driver move/rename,
>> but I can rebase if necessary.
>
> The patches applies cleanly on current mainline now, as all dependencies
> has already been merged, can this be considered for for merging too?
If no clocksource maintainer steps up in a week then notify me and
I'll simply stick these into the ux500 tree.
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 0/2] clocksource: nomadik-mtu: support timer-based delay
2012-12-17 18:38 ` Linus Walleij
@ 2012-12-17 18:59 ` John Stultz
2012-12-19 15:34 ` Linus Walleij
0 siblings, 1 reply; 9+ messages in thread
From: John Stultz @ 2012-12-17 18:59 UTC (permalink / raw)
To: Linus Walleij
Cc: Fabio Baltieri, Arnd Bergmann, Thomas Gleixner,
Rafael J. Wysocki, cpufreq, linux-pm, linux-arm-kernel,
linux-kernel
On 12/17/2012 10:38 AM, Linus Walleij wrote:
> On Mon, Dec 17, 2012 at 12:36 PM, Fabio Baltieri
> <fabio.baltieri@linaro.org> wrote:
>> On Tue, Dec 04, 2012 at 11:10:43AM +0100, Fabio Baltieri wrote:
>>> this implements timer-based delay support for nomadik and ux500
>>> platforms, using the MTU as time source, and marks the u8500 cpufreq
>>> driver as CPUFREQ_CONST_LOOPS accordingly.
>>>
>>> The patches are based on Arnd's arm-soc/ux500/mtu-clk branch, as that
>>> contains latest MTU driver developments, including a driver move/rename,
>>> but I can rebase if necessary.
>> The patches applies cleanly on current mainline now, as all dependencies
>> has already been merged, can this be considered for for merging too?
> If no clocksource maintainer steps up in a week then notify me and
> I'll simply stick these into the ux500 tree.
Yea, I'd actually prefer these go through the arch tree where they can
get testing.
thanks
-john
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 0/2] clocksource: nomadik-mtu: support timer-based delay
2012-12-17 18:59 ` John Stultz
@ 2012-12-19 15:34 ` Linus Walleij
0 siblings, 0 replies; 9+ messages in thread
From: Linus Walleij @ 2012-12-19 15:34 UTC (permalink / raw)
To: John Stultz
Cc: Fabio Baltieri, Arnd Bergmann, Thomas Gleixner,
Rafael J. Wysocki, cpufreq, linux-pm, linux-arm-kernel,
linux-kernel
On Mon, Dec 17, 2012 at 7:59 PM, John Stultz <john.stultz@linaro.org> wrote:
> On 12/17/2012 10:38 AM, Linus Walleij wrote:
>>
>> On Mon, Dec 17, 2012 at 12:36 PM, Fabio Baltieri
>> <fabio.baltieri@linaro.org> wrote:
>>>
>>> On Tue, Dec 04, 2012 at 11:10:43AM +0100, Fabio Baltieri wrote:
>>>>
>>>> this implements timer-based delay support for nomadik and ux500
>>>> platforms, using the MTU as time source, and marks the u8500 cpufreq
>>>> driver as CPUFREQ_CONST_LOOPS accordingly.
>>>>
>>>> The patches are based on Arnd's arm-soc/ux500/mtu-clk branch, as that
>>>> contains latest MTU driver developments, including a driver move/rename,
>>>> but I can rebase if necessary.
>>>
>>> The patches applies cleanly on current mainline now, as all dependencies
>>> has already been merged, can this be considered for for merging too?
>>
>> If no clocksource maintainer steps up in a week then notify me and
>> I'll simply stick these into the ux500 tree.
>
> Yea, I'd actually prefer these go through the arch tree where they can get
> testing.
OK, can I have your ACK?
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 9+ messages in thread