* [PATCH 01/40] ARM: AT91: update clock source registration
2010-12-17 11:32 [PATCH 0/40] Complete set of clocksource/sched_clock patches Russell King - ARM Linux
@ 2010-12-17 11:35 ` Russell King - ARM Linux
2010-12-17 13:01 ` Jean-Christophe PLAGNIOL-VILLARD
2010-12-17 11:35 ` [PATCH 02/40] ARM: bcmring: " Russell King - ARM Linux
` (47 subsequent siblings)
48 siblings, 1 reply; 77+ messages in thread
From: Russell King - ARM Linux @ 2010-12-17 11:35 UTC (permalink / raw)
To: linux-arm-kernel
In d7e81c2 (clocksource: Add clocksource_register_hz/khz interface) new
interfaces were added which simplify (and optimize) the selection of the
divisor shift/mult constants. Switch over to using this new interface.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
---
arch/arm/mach-at91/at91rm9200_time.c | 4 +---
arch/arm/mach-at91/at91sam926x_time.c | 4 +---
2 files changed, 2 insertions(+), 6 deletions(-)
diff --git a/arch/arm/mach-at91/at91rm9200_time.c b/arch/arm/mach-at91/at91rm9200_time.c
index 2500f41..1dd69c8 100644
--- a/arch/arm/mach-at91/at91rm9200_time.c
+++ b/arch/arm/mach-at91/at91rm9200_time.c
@@ -101,7 +101,6 @@ static struct clocksource clk32k = {
.rating = 150,
.read = read_clk32k,
.mask = CLOCKSOURCE_MASK(20),
- .shift = 10,
.flags = CLOCK_SOURCE_IS_CONTINUOUS,
};
@@ -201,8 +200,7 @@ void __init at91rm9200_timer_init(void)
clockevents_register_device(&clkevt);
/* register clocksource */
- clk32k.mult = clocksource_hz2mult(AT91_SLOW_CLOCK, clk32k.shift);
- clocksource_register(&clk32k);
+ clocksource_register_hz(&clk32k, AT91_SLOW_CLOCK);
}
struct sys_timer at91rm9200_timer = {
diff --git a/arch/arm/mach-at91/at91sam926x_time.c b/arch/arm/mach-at91/at91sam926x_time.c
index 608a632..4ba8549 100644
--- a/arch/arm/mach-at91/at91sam926x_time.c
+++ b/arch/arm/mach-at91/at91sam926x_time.c
@@ -51,7 +51,6 @@ static struct clocksource pit_clk = {
.name = "pit",
.rating = 175,
.read = read_pit_clk,
- .shift = 20,
.flags = CLOCK_SOURCE_IS_CONTINUOUS,
};
@@ -163,10 +162,9 @@ static void __init at91sam926x_pit_init(void)
* Register clocksource. The high order bits of PIV are unused,
* so this isn't a 32-bit counter unless we get clockevent irqs.
*/
- pit_clk.mult = clocksource_hz2mult(pit_rate, pit_clk.shift);
bits = 12 /* PICNT */ + ilog2(pit_cycle) /* PIV */;
pit_clk.mask = CLOCKSOURCE_MASK(bits);
- clocksource_register(&pit_clk);
+ clocksource_register_hz(&pit_clk, pit_rate);
/* Set up irq handler */
setup_irq(AT91_ID_SYS, &at91sam926x_pit_irq);
--
1.6.2.5
^ permalink raw reply related [flat|nested] 77+ messages in thread* [PATCH 02/40] ARM: bcmring: update clock source registration
2010-12-17 11:32 [PATCH 0/40] Complete set of clocksource/sched_clock patches Russell King - ARM Linux
2010-12-17 11:35 ` [PATCH 01/40] ARM: AT91: update clock source registration Russell King - ARM Linux
@ 2010-12-17 11:35 ` Russell King - ARM Linux
2010-12-17 11:36 ` [PATCH 03/40] ARM: davinci: " Russell King - ARM Linux
` (46 subsequent siblings)
48 siblings, 0 replies; 77+ messages in thread
From: Russell King - ARM Linux @ 2010-12-17 11:35 UTC (permalink / raw)
To: linux-arm-kernel
In d7e81c2 (clocksource: Add clocksource_register_hz/khz interface) new
interfaces were added which simplify (and optimize) the selection of the
divisor shift/mult constants. Switch over to using this new interface.
Acked-By: Scott Branden <sbranden@broadcom.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
---
arch/arm/mach-bcmring/core.c | 14 ++++----------
1 files changed, 4 insertions(+), 10 deletions(-)
diff --git a/arch/arm/mach-bcmring/core.c b/arch/arm/mach-bcmring/core.c
index d3f959e..b91b1b0 100644
--- a/arch/arm/mach-bcmring/core.c
+++ b/arch/arm/mach-bcmring/core.c
@@ -294,7 +294,6 @@ static struct clocksource clocksource_bcmring_timer1 = {
.rating = 200,
.read = bcmring_get_cycles_timer1,
.mask = CLOCKSOURCE_MASK(32),
- .shift = 20,
.flags = CLOCK_SOURCE_IS_CONTINUOUS,
};
@@ -303,7 +302,6 @@ static struct clocksource clocksource_bcmring_timer3 = {
.rating = 100,
.read = bcmring_get_cycles_timer3,
.mask = CLOCKSOURCE_MASK(32),
- .shift = 20,
.flags = CLOCK_SOURCE_IS_CONTINUOUS,
};
@@ -316,10 +314,8 @@ static int __init bcmring_clocksource_init(void)
writel(TIMER_CTRL_32BIT | TIMER_CTRL_ENABLE | TIMER_CTRL_PERIODIC,
TIMER1_VA_BASE + TIMER_CTRL);
- clocksource_bcmring_timer1.mult =
- clocksource_khz2mult(TIMER1_FREQUENCY_MHZ * 1000,
- clocksource_bcmring_timer1.shift);
- clocksource_register(&clocksource_bcmring_timer1);
+ clocksource_register_khz(&clocksource_bcmring_timer1,
+ TIMER1_FREQUENCY_MHZ * 1000);
/* setup timer3 as free-running clocksource */
writel(0, TIMER3_VA_BASE + TIMER_CTRL);
@@ -328,10 +324,8 @@ static int __init bcmring_clocksource_init(void)
writel(TIMER_CTRL_32BIT | TIMER_CTRL_ENABLE | TIMER_CTRL_PERIODIC,
TIMER3_VA_BASE + TIMER_CTRL);
- clocksource_bcmring_timer3.mult =
- clocksource_khz2mult(TIMER3_FREQUENCY_KHZ,
- clocksource_bcmring_timer3.shift);
- clocksource_register(&clocksource_bcmring_timer3);
+ clocksource_register_khz(&clocksource_bcmring_timer3,
+ TIMER3_FREQUENCY_KHZ);
return 0;
}
--
1.6.2.5
^ permalink raw reply related [flat|nested] 77+ messages in thread* [PATCH 03/40] ARM: davinci: update clock source registration
2010-12-17 11:32 [PATCH 0/40] Complete set of clocksource/sched_clock patches Russell King - ARM Linux
2010-12-17 11:35 ` [PATCH 01/40] ARM: AT91: update clock source registration Russell King - ARM Linux
2010-12-17 11:35 ` [PATCH 02/40] ARM: bcmring: " Russell King - ARM Linux
@ 2010-12-17 11:36 ` Russell King - ARM Linux
2010-12-21 19:23 ` Kevin Hilman
2010-12-17 11:36 ` [PATCH 04/40] ARM: integrator: " Russell King - ARM Linux
` (45 subsequent siblings)
48 siblings, 1 reply; 77+ messages in thread
From: Russell King - ARM Linux @ 2010-12-17 11:36 UTC (permalink / raw)
To: linux-arm-kernel
In d7e81c2 (clocksource: Add clocksource_register_hz/khz interface) new
interfaces were added which simplify (and optimize) the selection of the
divisor shift/mult constants. Switch over to using this new interface.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
---
arch/arm/mach-davinci/time.c | 7 ++-----
1 files changed, 2 insertions(+), 5 deletions(-)
diff --git a/arch/arm/mach-davinci/time.c b/arch/arm/mach-davinci/time.c
index 0f21c36..c148671 100644
--- a/arch/arm/mach-davinci/time.c
+++ b/arch/arm/mach-davinci/time.c
@@ -276,7 +276,6 @@ static struct clocksource clocksource_davinci = {
.rating = 300,
.read = read_cycles,
.mask = CLOCKSOURCE_MASK(32),
- .shift = 24,
.flags = CLOCK_SOURCE_IS_CONTINUOUS,
};
@@ -378,10 +377,8 @@ static void __init davinci_timer_init(void)
/* setup clocksource */
clocksource_davinci.name = id_to_name[clocksource_id];
- clocksource_davinci.mult =
- clocksource_khz2mult(davinci_clock_tick_rate/1000,
- clocksource_davinci.shift);
- if (clocksource_register(&clocksource_davinci))
+ if (clocksource_register_hz(&clocksource_davinci,
+ davinci_clock_tick_rate))
printk(err, clocksource_davinci.name);
/* setup clockevent */
--
1.6.2.5
^ permalink raw reply related [flat|nested] 77+ messages in thread* [PATCH 03/40] ARM: davinci: update clock source registration
2010-12-17 11:36 ` [PATCH 03/40] ARM: davinci: " Russell King - ARM Linux
@ 2010-12-21 19:23 ` Kevin Hilman
0 siblings, 0 replies; 77+ messages in thread
From: Kevin Hilman @ 2010-12-21 19:23 UTC (permalink / raw)
To: linux-arm-kernel
Russell King - ARM Linux <linux@arm.linux.org.uk> writes:
> In d7e81c2 (clocksource: Add clocksource_register_hz/khz interface) new
> interfaces were added which simplify (and optimize) the selection of the
> divisor shift/mult constants. Switch over to using this new interface.
>
> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Acked-by: Kevin Hilman <khilman@deeprootsystems.com>
> ---
> arch/arm/mach-davinci/time.c | 7 ++-----
> 1 files changed, 2 insertions(+), 5 deletions(-)
>
> diff --git a/arch/arm/mach-davinci/time.c b/arch/arm/mach-davinci/time.c
> index 0f21c36..c148671 100644
> --- a/arch/arm/mach-davinci/time.c
> +++ b/arch/arm/mach-davinci/time.c
> @@ -276,7 +276,6 @@ static struct clocksource clocksource_davinci = {
> .rating = 300,
> .read = read_cycles,
> .mask = CLOCKSOURCE_MASK(32),
> - .shift = 24,
> .flags = CLOCK_SOURCE_IS_CONTINUOUS,
> };
>
> @@ -378,10 +377,8 @@ static void __init davinci_timer_init(void)
>
> /* setup clocksource */
> clocksource_davinci.name = id_to_name[clocksource_id];
> - clocksource_davinci.mult =
> - clocksource_khz2mult(davinci_clock_tick_rate/1000,
> - clocksource_davinci.shift);
> - if (clocksource_register(&clocksource_davinci))
> + if (clocksource_register_hz(&clocksource_davinci,
> + davinci_clock_tick_rate))
> printk(err, clocksource_davinci.name);
>
> /* setup clockevent */
^ permalink raw reply [flat|nested] 77+ messages in thread
* [PATCH 04/40] ARM: integrator: update clock source registration
2010-12-17 11:32 [PATCH 0/40] Complete set of clocksource/sched_clock patches Russell King - ARM Linux
` (2 preceding siblings ...)
2010-12-17 11:36 ` [PATCH 03/40] ARM: davinci: " Russell King - ARM Linux
@ 2010-12-17 11:36 ` Russell King - ARM Linux
2010-12-17 11:37 ` [PATCH 05/40] ARM: ixp4xx: " Russell King - ARM Linux
` (44 subsequent siblings)
48 siblings, 0 replies; 77+ messages in thread
From: Russell King - ARM Linux @ 2010-12-17 11:36 UTC (permalink / raw)
To: linux-arm-kernel
In d7e81c2 (clocksource: Add clocksource_register_hz/khz interface) new
interfaces were added which simplify (and optimize) the selection of the
divisor shift/mult constants. Switch over to using this new interface.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
---
arch/arm/mach-integrator/integrator_ap.c | 4 +---
1 files changed, 1 insertions(+), 3 deletions(-)
diff --git a/arch/arm/mach-integrator/integrator_ap.c b/arch/arm/mach-integrator/integrator_ap.c
index 548208f..2774df8 100644
--- a/arch/arm/mach-integrator/integrator_ap.c
+++ b/arch/arm/mach-integrator/integrator_ap.c
@@ -372,7 +372,6 @@ static struct clocksource clocksource_timersp = {
.rating = 200,
.read = timersp_read,
.mask = CLOCKSOURCE_MASK(16),
- .shift = 16,
.flags = CLOCK_SOURCE_IS_CONTINUOUS,
};
@@ -390,8 +389,7 @@ static void integrator_clocksource_init(u32 khz)
writel(ctrl, base + TIMER_CTRL);
writel(0xffff, base + TIMER_LOAD);
- cs->mult = clocksource_khz2mult(khz, cs->shift);
- clocksource_register(cs);
+ clocksource_register_khz(cs, khz);
}
static void __iomem * const clkevt_base = (void __iomem *)TIMER1_VA_BASE;
--
1.6.2.5
^ permalink raw reply related [flat|nested] 77+ messages in thread* [PATCH 05/40] ARM: ixp4xx: update clock source registration
2010-12-17 11:32 [PATCH 0/40] Complete set of clocksource/sched_clock patches Russell King - ARM Linux
` (3 preceding siblings ...)
2010-12-17 11:36 ` [PATCH 04/40] ARM: integrator: " Russell King - ARM Linux
@ 2010-12-17 11:37 ` Russell King - ARM Linux
2010-12-17 11:37 ` [PATCH 06/40] ARM: lpc32xx: " Russell King - ARM Linux
` (43 subsequent siblings)
48 siblings, 0 replies; 77+ messages in thread
From: Russell King - ARM Linux @ 2010-12-17 11:37 UTC (permalink / raw)
To: linux-arm-kernel
In d7e81c2 (clocksource: Add clocksource_register_hz/khz interface) new
interfaces were added which simplify (and optimize) the selection of the
divisor shift/mult constants. Switch over to using this new interface.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
---
arch/arm/mach-ixp4xx/common.c | 6 +-----
1 files changed, 1 insertions(+), 5 deletions(-)
diff --git a/arch/arm/mach-ixp4xx/common.c b/arch/arm/mach-ixp4xx/common.c
index 0bce097..82fc003 100644
--- a/arch/arm/mach-ixp4xx/common.c
+++ b/arch/arm/mach-ixp4xx/common.c
@@ -411,7 +411,6 @@ static struct clocksource clocksource_ixp4xx = {
.rating = 200,
.read = ixp4xx_get_cycles,
.mask = CLOCKSOURCE_MASK(32),
- .shift = 20,
.flags = CLOCK_SOURCE_IS_CONTINUOUS,
};
@@ -419,10 +418,7 @@ unsigned long ixp4xx_timer_freq = FREQ;
EXPORT_SYMBOL(ixp4xx_timer_freq);
static void __init ixp4xx_clocksource_init(void)
{
- clocksource_ixp4xx.mult =
- clocksource_hz2mult(ixp4xx_timer_freq,
- clocksource_ixp4xx.shift);
- clocksource_register(&clocksource_ixp4xx);
+ clocksource_register_hz(&clocksource_ixp4xx, ixp4xx_timer_freq);
}
/*
--
1.6.2.5
^ permalink raw reply related [flat|nested] 77+ messages in thread* [PATCH 06/40] ARM: lpc32xx: update clock source registration
2010-12-17 11:32 [PATCH 0/40] Complete set of clocksource/sched_clock patches Russell King - ARM Linux
` (4 preceding siblings ...)
2010-12-17 11:37 ` [PATCH 05/40] ARM: ixp4xx: " Russell King - ARM Linux
@ 2010-12-17 11:37 ` Russell King - ARM Linux
2010-12-17 11:37 ` [PATCH 07/40] ARM: mmp: " Russell King - ARM Linux
` (42 subsequent siblings)
48 siblings, 0 replies; 77+ messages in thread
From: Russell King - ARM Linux @ 2010-12-17 11:37 UTC (permalink / raw)
To: linux-arm-kernel
In d7e81c2 (clocksource: Add clocksource_register_hz/khz interface) new
interfaces were added which simplify (and optimize) the selection of the
divisor shift/mult constants. Switch over to using this new interface.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
---
arch/arm/mach-lpc32xx/timer.c | 5 +----
1 files changed, 1 insertions(+), 4 deletions(-)
diff --git a/arch/arm/mach-lpc32xx/timer.c b/arch/arm/mach-lpc32xx/timer.c
index 630dd4a..6162ac3 100644
--- a/arch/arm/mach-lpc32xx/timer.c
+++ b/arch/arm/mach-lpc32xx/timer.c
@@ -38,7 +38,6 @@ static cycle_t lpc32xx_clksrc_read(struct clocksource *cs)
static struct clocksource lpc32xx_clksrc = {
.name = "lpc32xx_clksrc",
- .shift = 24,
.rating = 300,
.read = lpc32xx_clksrc_read,
.mask = CLOCKSOURCE_MASK(32),
@@ -171,9 +170,7 @@ static void __init lpc32xx_timer_init(void)
__raw_writel(0, LCP32XX_TIMER_MCR(LPC32XX_TIMER1_BASE));
__raw_writel(LCP32XX_TIMER_CNTR_TCR_EN,
LCP32XX_TIMER_TCR(LPC32XX_TIMER1_BASE));
- lpc32xx_clksrc.mult = clocksource_hz2mult(clkrate,
- lpc32xx_clksrc.shift);
- clocksource_register(&lpc32xx_clksrc);
+ clocksource_register_hz(&lpc32xx_clksrc, clkrate);
}
struct sys_timer lpc32xx_timer = {
--
1.6.2.5
^ permalink raw reply related [flat|nested] 77+ messages in thread* [PATCH 07/40] ARM: mmp: update clock source registration
2010-12-17 11:32 [PATCH 0/40] Complete set of clocksource/sched_clock patches Russell King - ARM Linux
` (5 preceding siblings ...)
2010-12-17 11:37 ` [PATCH 06/40] ARM: lpc32xx: " Russell King - ARM Linux
@ 2010-12-17 11:37 ` Russell King - ARM Linux
2010-12-17 11:38 ` [PATCH 08/40] ARM: MSM: " Russell King - ARM Linux
` (41 subsequent siblings)
48 siblings, 0 replies; 77+ messages in thread
From: Russell King - ARM Linux @ 2010-12-17 11:37 UTC (permalink / raw)
To: linux-arm-kernel
In d7e81c2 (clocksource: Add clocksource_register_hz/khz interface) new
interfaces were added which simplify (and optimize) the selection of the
divisor shift/mult constants. Switch over to using this new interface.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
---
arch/arm/mach-mmp/time.c | 5 +----
1 files changed, 1 insertions(+), 4 deletions(-)
diff --git a/arch/arm/mach-mmp/time.c b/arch/arm/mach-mmp/time.c
index 6652819..0c0ab09 100644
--- a/arch/arm/mach-mmp/time.c
+++ b/arch/arm/mach-mmp/time.c
@@ -146,7 +146,6 @@ static cycle_t clksrc_read(struct clocksource *cs)
static struct clocksource cksrc = {
.name = "clocksource",
- .shift = 20,
.rating = 200,
.read = clksrc_read,
.mask = CLOCKSOURCE_MASK(32),
@@ -193,10 +192,8 @@ void __init timer_init(int irq)
ckevt.min_delta_ns = clockevent_delta2ns(MIN_DELTA, &ckevt);
ckevt.cpumask = cpumask_of(0);
- cksrc.mult = clocksource_hz2mult(CLOCK_TICK_RATE, cksrc.shift);
-
setup_irq(irq, &timer_irq);
- clocksource_register(&cksrc);
+ clocksource_register_hz(&cksrc, CLOCK_TICK_RATE);
clockevents_register_device(&ckevt);
}
--
1.6.2.5
^ permalink raw reply related [flat|nested] 77+ messages in thread* [PATCH 08/40] ARM: MSM: update clock source registration
2010-12-17 11:32 [PATCH 0/40] Complete set of clocksource/sched_clock patches Russell King - ARM Linux
` (6 preceding siblings ...)
2010-12-17 11:37 ` [PATCH 07/40] ARM: mmp: " Russell King - ARM Linux
@ 2010-12-17 11:38 ` Russell King - ARM Linux
2010-12-17 21:23 ` David Brown
2010-12-17 11:38 ` [PATCH 09/40] ARM: netx: " Russell King - ARM Linux
` (40 subsequent siblings)
48 siblings, 1 reply; 77+ messages in thread
From: Russell King - ARM Linux @ 2010-12-17 11:38 UTC (permalink / raw)
To: linux-arm-kernel
In d7e81c2 (clocksource: Add clocksource_register_hz/khz interface) new
interfaces were added which simplify (and optimize) the selection of the
divisor shift/mult constants. Switch over to using this new interface.
Tested-By: Jeff Ohlstein <johlstei@codeaurora.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
---
arch/arm/mach-msm/timer.c | 5 +----
1 files changed, 1 insertions(+), 4 deletions(-)
diff --git a/arch/arm/mach-msm/timer.c b/arch/arm/mach-msm/timer.c
index 950100f..595be7f 100644
--- a/arch/arm/mach-msm/timer.c
+++ b/arch/arm/mach-msm/timer.c
@@ -137,7 +137,6 @@ static struct msm_clock msm_clocks[] = {
.rating = 200,
.read = msm_gpt_read,
.mask = CLOCKSOURCE_MASK(32),
- .shift = 17,
.flags = CLOCK_SOURCE_IS_CONTINUOUS,
},
.irq = {
@@ -164,7 +163,6 @@ static struct msm_clock msm_clocks[] = {
.rating = 300,
.read = msm_dgt_read,
.mask = CLOCKSOURCE_MASK((32 - MSM_DGT_SHIFT)),
- .shift = 24 - MSM_DGT_SHIFT,
.flags = CLOCK_SOURCE_IS_CONTINUOUS,
},
.irq = {
@@ -205,8 +203,7 @@ static void __init msm_timer_init(void)
ce->min_delta_ns = clockevent_delta2ns(4, ce);
ce->cpumask = cpumask_of(0);
- cs->mult = clocksource_hz2mult(clock->freq, cs->shift);
- res = clocksource_register(cs);
+ res = clocksource_register_hz(cs, clock->freq);
if (res)
printk(KERN_ERR "msm_timer_init: clocksource_register "
"failed for %s\n", cs->name);
--
1.6.2.5
^ permalink raw reply related [flat|nested] 77+ messages in thread* [PATCH 08/40] ARM: MSM: update clock source registration
2010-12-17 11:38 ` [PATCH 08/40] ARM: MSM: " Russell King - ARM Linux
@ 2010-12-17 21:23 ` David Brown
0 siblings, 0 replies; 77+ messages in thread
From: David Brown @ 2010-12-17 21:23 UTC (permalink / raw)
To: linux-arm-kernel
On Fri, Dec 17, 2010 at 11:38:02AM +0000, Russell King - ARM Linux wrote:
> In d7e81c2 (clocksource: Add clocksource_register_hz/khz interface) new
> interfaces were added which simplify (and optimize) the selection of the
> divisor shift/mult constants. Switch over to using this new interface.
>
> Tested-By: Jeff Ohlstein <johlstei@codeaurora.org>
> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Acked-by: David Brown <davidb@codeaurora.org>
--
Sent by an employee of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.
^ permalink raw reply [flat|nested] 77+ messages in thread
* [PATCH 09/40] ARM: netx: update clock source registration
2010-12-17 11:32 [PATCH 0/40] Complete set of clocksource/sched_clock patches Russell King - ARM Linux
` (7 preceding siblings ...)
2010-12-17 11:38 ` [PATCH 08/40] ARM: MSM: " Russell King - ARM Linux
@ 2010-12-17 11:38 ` Russell King - ARM Linux
2010-12-17 11:38 ` [PATCH 10/40] ARM: ns9xxx: " Russell King - ARM Linux
` (39 subsequent siblings)
48 siblings, 0 replies; 77+ messages in thread
From: Russell King - ARM Linux @ 2010-12-17 11:38 UTC (permalink / raw)
To: linux-arm-kernel
In d7e81c2 (clocksource: Add clocksource_register_hz/khz interface) new
interfaces were added which simplify (and optimize) the selection of the
divisor shift/mult constants. Switch over to using this new interface.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
---
arch/arm/mach-netx/time.c | 5 +----
1 files changed, 1 insertions(+), 4 deletions(-)
diff --git a/arch/arm/mach-netx/time.c b/arch/arm/mach-netx/time.c
index 82801db..f12f22d 100644
--- a/arch/arm/mach-netx/time.c
+++ b/arch/arm/mach-netx/time.c
@@ -114,7 +114,6 @@ static struct clocksource clocksource_netx = {
.rating = 200,
.read = netx_get_cycles,
.mask = CLOCKSOURCE_MASK(32),
- .shift = 20,
.flags = CLOCK_SOURCE_IS_CONTINUOUS,
};
@@ -151,9 +150,7 @@ static void __init netx_timer_init(void)
writel(NETX_GPIO_COUNTER_CTRL_RUN,
NETX_GPIO_COUNTER_CTRL(TIMER_CLOCKSOURCE));
- clocksource_netx.mult =
- clocksource_hz2mult(CLOCK_TICK_RATE, clocksource_netx.shift);
- clocksource_register(&clocksource_netx);
+ clocksource_register_hz(&clocksource_netx, CLOCK_TICK_RATE);
netx_clockevent.mult = div_sc(CLOCK_TICK_RATE, NSEC_PER_SEC,
netx_clockevent.shift);
--
1.6.2.5
^ permalink raw reply related [flat|nested] 77+ messages in thread* [PATCH 10/40] ARM: ns9xxx: update clock source registration
2010-12-17 11:32 [PATCH 0/40] Complete set of clocksource/sched_clock patches Russell King - ARM Linux
` (8 preceding siblings ...)
2010-12-17 11:38 ` [PATCH 09/40] ARM: netx: " Russell King - ARM Linux
@ 2010-12-17 11:38 ` Russell King - ARM Linux
2010-12-17 11:39 ` [PATCH 11/40] ARM: omap: " Russell King - ARM Linux
` (38 subsequent siblings)
48 siblings, 0 replies; 77+ messages in thread
From: Russell King - ARM Linux @ 2010-12-17 11:38 UTC (permalink / raw)
To: linux-arm-kernel
In d7e81c2 (clocksource: Add clocksource_register_hz/khz interface) new
interfaces were added which simplify (and optimize) the selection of the
divisor shift/mult constants. Switch over to using this new interface.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
---
arch/arm/mach-ns9xxx/time-ns9360.c | 6 +-----
1 files changed, 1 insertions(+), 5 deletions(-)
diff --git a/arch/arm/mach-ns9xxx/time-ns9360.c b/arch/arm/mach-ns9xxx/time-ns9360.c
index 7728126..9ca32f5 100644
--- a/arch/arm/mach-ns9xxx/time-ns9360.c
+++ b/arch/arm/mach-ns9xxx/time-ns9360.c
@@ -35,7 +35,6 @@ static struct clocksource ns9360_clocksource = {
.rating = 300,
.read = ns9360_clocksource_read,
.mask = CLOCKSOURCE_MASK(32),
- .shift = 20,
.flags = CLOCK_SOURCE_IS_CONTINUOUS,
};
@@ -148,10 +147,7 @@ static void __init ns9360_timer_init(void)
__raw_writel(tc, SYS_TC(TIMER_CLOCKSOURCE));
- ns9360_clocksource.mult = clocksource_hz2mult(ns9360_cpuclock(),
- ns9360_clocksource.shift);
-
- clocksource_register(&ns9360_clocksource);
+ clocksource_register_hz(&ns9360_clocksource, ns9360_cpuclock());
latch = SH_DIV(ns9360_cpuclock(), HZ, 0);
--
1.6.2.5
^ permalink raw reply related [flat|nested] 77+ messages in thread* [PATCH 11/40] ARM: omap: update clock source registration
2010-12-17 11:32 [PATCH 0/40] Complete set of clocksource/sched_clock patches Russell King - ARM Linux
` (9 preceding siblings ...)
2010-12-17 11:38 ` [PATCH 10/40] ARM: ns9xxx: " Russell King - ARM Linux
@ 2010-12-17 11:39 ` Russell King - ARM Linux
2010-12-17 11:39 ` [PATCH 12/40] ARM: PXA: " Russell King - ARM Linux
` (37 subsequent siblings)
48 siblings, 0 replies; 77+ messages in thread
From: Russell King - ARM Linux @ 2010-12-17 11:39 UTC (permalink / raw)
To: linux-arm-kernel
In d7e81c2 (clocksource: Add clocksource_register_hz/khz interface) new
interfaces were added which simplify (and optimize) the selection of the
divisor shift/mult constants. Switch over to using this new interface.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
---
arch/arm/mach-omap1/time.c | 6 +-----
arch/arm/mach-omap2/timer-gp.c | 5 +----
arch/arm/plat-omap/counter_32k.c | 6 +-----
3 files changed, 3 insertions(+), 14 deletions(-)
diff --git a/arch/arm/mach-omap1/time.c b/arch/arm/mach-omap1/time.c
index 1be6a21..abb34ff 100644
--- a/arch/arm/mach-omap1/time.c
+++ b/arch/arm/mach-omap1/time.c
@@ -208,7 +208,6 @@ static struct clocksource clocksource_mpu = {
.rating = 300,
.read = mpu_read,
.mask = CLOCKSOURCE_MASK(32),
- .shift = 24,
.flags = CLOCK_SOURCE_IS_CONTINUOUS,
};
@@ -217,13 +216,10 @@ static void __init omap_init_clocksource(unsigned long rate)
static char err[] __initdata = KERN_ERR
"%s: can't register clocksource!\n";
- clocksource_mpu.mult
- = clocksource_khz2mult(rate/1000, clocksource_mpu.shift);
-
setup_irq(INT_TIMER2, &omap_mpu_timer2_irq);
omap_mpu_timer_start(1, ~0, 1);
- if (clocksource_register(&clocksource_mpu))
+ if (clocksource_register_hz(&clocksource_mpu, rate))
printk(err, clocksource_mpu.name);
}
diff --git a/arch/arm/mach-omap2/timer-gp.c b/arch/arm/mach-omap2/timer-gp.c
index e13c29e..a7816db 100644
--- a/arch/arm/mach-omap2/timer-gp.c
+++ b/arch/arm/mach-omap2/timer-gp.c
@@ -195,7 +195,6 @@ static struct clocksource clocksource_gpt = {
.rating = 300,
.read = clocksource_read_cycles,
.mask = CLOCKSOURCE_MASK(32),
- .shift = 24,
.flags = CLOCK_SOURCE_IS_CONTINUOUS,
};
@@ -220,9 +219,7 @@ static void __init omap2_gp_clocksource_init(void)
omap_dm_timer_set_load_start(gpt, 1, 0);
- clocksource_gpt.mult =
- clocksource_khz2mult(tick_rate/1000, clocksource_gpt.shift);
- if (clocksource_register(&clocksource_gpt))
+ if (clocksource_register_hz(&clocksource_gpt, tick_rate))
printk(err2, clocksource_gpt.name);
}
#endif
diff --git a/arch/arm/plat-omap/counter_32k.c b/arch/arm/plat-omap/counter_32k.c
index 155fe43..8f149f5 100644
--- a/arch/arm/plat-omap/counter_32k.c
+++ b/arch/arm/plat-omap/counter_32k.c
@@ -102,7 +102,6 @@ static struct clocksource clocksource_32k = {
.rating = 250,
.read = omap_32k_read_dummy,
.mask = CLOCKSOURCE_MASK(32),
- .shift = 10,
.flags = CLOCK_SOURCE_IS_CONTINUOUS,
};
@@ -167,12 +166,9 @@ static int __init omap_init_clocksource_32k(void)
if (sync_32k_ick)
clk_enable(sync_32k_ick);
- clocksource_32k.mult = clocksource_hz2mult(32768,
- clocksource_32k.shift);
-
offset_32k = clocksource_32k.read(&clocksource_32k);
- if (clocksource_register(&clocksource_32k))
+ if (clocksource_register_hz(&clocksource_32k, 32768))
printk(err, clocksource_32k.name);
}
return 0;
--
1.6.2.5
^ permalink raw reply related [flat|nested] 77+ messages in thread* [PATCH 12/40] ARM: PXA: update clock source registration
2010-12-17 11:32 [PATCH 0/40] Complete set of clocksource/sched_clock patches Russell King - ARM Linux
` (10 preceding siblings ...)
2010-12-17 11:39 ` [PATCH 11/40] ARM: omap: " Russell King - ARM Linux
@ 2010-12-17 11:39 ` Russell King - ARM Linux
2010-12-17 11:39 ` [PATCH 13/40] ARM: s5pv310: " Russell King - ARM Linux
` (36 subsequent siblings)
48 siblings, 0 replies; 77+ messages in thread
From: Russell King - ARM Linux @ 2010-12-17 11:39 UTC (permalink / raw)
To: linux-arm-kernel
In d7e81c2 (clocksource: Add clocksource_register_hz/khz interface) new
interfaces were added which simplify (and optimize) the selection of the
divisor shift/mult constants. Switch over to using this new interface.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
---
arch/arm/mach-pxa/time.c | 6 +-----
1 files changed, 1 insertions(+), 5 deletions(-)
diff --git a/arch/arm/mach-pxa/time.c b/arch/arm/mach-pxa/time.c
index 293e40a..caf92c0 100644
--- a/arch/arm/mach-pxa/time.c
+++ b/arch/arm/mach-pxa/time.c
@@ -127,7 +127,6 @@ static struct clocksource cksrc_pxa_oscr0 = {
.rating = 200,
.read = pxa_read_oscr,
.mask = CLOCKSOURCE_MASK(32),
- .shift = 20,
.flags = CLOCK_SOURCE_IS_CONTINUOUS,
};
@@ -155,12 +154,9 @@ static void __init pxa_timer_init(void)
clockevent_delta2ns(MIN_OSCR_DELTA * 2, &ckevt_pxa_osmr0) + 1;
ckevt_pxa_osmr0.cpumask = cpumask_of(0);
- cksrc_pxa_oscr0.mult =
- clocksource_hz2mult(clock_tick_rate, cksrc_pxa_oscr0.shift);
-
setup_irq(IRQ_OST0, &pxa_ost0_irq);
- clocksource_register(&cksrc_pxa_oscr0);
+ clocksource_register_hz(&cksrc_pxa_oscr0, clock_tick_rate);
clockevents_register_device(&ckevt_pxa_osmr0);
}
--
1.6.2.5
^ permalink raw reply related [flat|nested] 77+ messages in thread* [PATCH 13/40] ARM: s5pv310: update clock source registration
2010-12-17 11:32 [PATCH 0/40] Complete set of clocksource/sched_clock patches Russell King - ARM Linux
` (11 preceding siblings ...)
2010-12-17 11:39 ` [PATCH 12/40] ARM: PXA: " Russell King - ARM Linux
@ 2010-12-17 11:39 ` Russell King - ARM Linux
2010-12-17 11:40 ` [PATCH 14/40] ARM: SA11x0: " Russell King - ARM Linux
` (35 subsequent siblings)
48 siblings, 0 replies; 77+ messages in thread
From: Russell King - ARM Linux @ 2010-12-17 11:39 UTC (permalink / raw)
To: linux-arm-kernel
In d7e81c2 (clocksource: Add clocksource_register_hz/khz interface) new
interfaces were added which simplify (and optimize) the selection of the
divisor shift/mult constants. Switch over to using this new interface.
Acked-by: Kukjin Kim <kgene.kim@samsung.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
---
arch/arm/mach-s5pv310/time.c | 6 +-----
1 files changed, 1 insertions(+), 5 deletions(-)
diff --git a/arch/arm/mach-s5pv310/time.c b/arch/arm/mach-s5pv310/time.c
index 01b012a..b262d46 100644
--- a/arch/arm/mach-s5pv310/time.c
+++ b/arch/arm/mach-s5pv310/time.c
@@ -211,7 +211,6 @@ struct clocksource pwm_clocksource = {
.rating = 250,
.read = s5pv310_pwm4_read,
.mask = CLOCKSOURCE_MASK(32),
- .shift = 20,
.flags = CLOCK_SOURCE_IS_CONTINUOUS ,
};
@@ -230,10 +229,7 @@ static void __init s5pv310_clocksource_init(void)
s5pv310_pwm_init(4, ~0);
s5pv310_pwm_start(4, 1);
- pwm_clocksource.mult =
- clocksource_khz2mult(clock_rate/1000, pwm_clocksource.shift);
-
- if (clocksource_register(&pwm_clocksource))
+ if (clocksource_register_hz(&pwm_clocksource, clock_rate))
panic("%s: can't register clocksource\n", pwm_clocksource.name);
}
--
1.6.2.5
^ permalink raw reply related [flat|nested] 77+ messages in thread* [PATCH 14/40] ARM: SA11x0: update clock source registration
2010-12-17 11:32 [PATCH 0/40] Complete set of clocksource/sched_clock patches Russell King - ARM Linux
` (12 preceding siblings ...)
2010-12-17 11:39 ` [PATCH 13/40] ARM: s5pv310: " Russell King - ARM Linux
@ 2010-12-17 11:40 ` Russell King - ARM Linux
2010-12-17 11:40 ` [PATCH 15/40] ARM: tcc8k: " Russell King - ARM Linux
` (34 subsequent siblings)
48 siblings, 0 replies; 77+ messages in thread
From: Russell King - ARM Linux @ 2010-12-17 11:40 UTC (permalink / raw)
To: linux-arm-kernel
In d7e81c2 (clocksource: Add clocksource_register_hz/khz interface) new
interfaces were added which simplify (and optimize) the selection of the
divisor shift/mult constants. Switch over to using this new interface.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
---
arch/arm/mach-sa1100/time.c | 6 +-----
1 files changed, 1 insertions(+), 5 deletions(-)
diff --git a/arch/arm/mach-sa1100/time.c b/arch/arm/mach-sa1100/time.c
index 74b6e0e..96154f5 100644
--- a/arch/arm/mach-sa1100/time.c
+++ b/arch/arm/mach-sa1100/time.c
@@ -81,7 +81,6 @@ static struct clocksource cksrc_sa1100_oscr = {
.rating = 200,
.read = sa1100_read_oscr,
.mask = CLOCKSOURCE_MASK(32),
- .shift = 20,
.flags = CLOCK_SOURCE_IS_CONTINUOUS,
};
@@ -105,12 +104,9 @@ static void __init sa1100_timer_init(void)
clockevent_delta2ns(MIN_OSCR_DELTA * 2, &ckevt_sa1100_osmr0) + 1;
ckevt_sa1100_osmr0.cpumask = cpumask_of(0);
- cksrc_sa1100_oscr.mult =
- clocksource_hz2mult(CLOCK_TICK_RATE, cksrc_sa1100_oscr.shift);
-
setup_irq(IRQ_OST0, &sa1100_timer_irq);
- clocksource_register(&cksrc_sa1100_oscr);
+ clocksource_register_hz(&cksrc_sa1100_oscr, CLOCK_TICK_RATE);
clockevents_register_device(&ckevt_sa1100_osmr0);
}
--
1.6.2.5
^ permalink raw reply related [flat|nested] 77+ messages in thread* [PATCH 15/40] ARM: tcc8k: update clock source registration
2010-12-17 11:32 [PATCH 0/40] Complete set of clocksource/sched_clock patches Russell King - ARM Linux
` (13 preceding siblings ...)
2010-12-17 11:40 ` [PATCH 14/40] ARM: SA11x0: " Russell King - ARM Linux
@ 2010-12-17 11:40 ` Russell King - ARM Linux
2010-12-17 11:40 ` [PATCH 16/40] ARM: U300: " Russell King - ARM Linux
` (33 subsequent siblings)
48 siblings, 0 replies; 77+ messages in thread
From: Russell King - ARM Linux @ 2010-12-17 11:40 UTC (permalink / raw)
To: linux-arm-kernel
In d7e81c2 (clocksource: Add clocksource_register_hz/khz interface) new
interfaces were added which simplify (and optimize) the selection of the
divisor shift/mult constants. Switch over to using this new interface.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
---
arch/arm/mach-tcc8k/time.c | 5 +----
1 files changed, 1 insertions(+), 4 deletions(-)
diff --git a/arch/arm/mach-tcc8k/time.c b/arch/arm/mach-tcc8k/time.c
index 78d0600..e0a8d60 100644
--- a/arch/arm/mach-tcc8k/time.c
+++ b/arch/arm/mach-tcc8k/time.c
@@ -35,7 +35,6 @@ static struct clocksource clocksource_tcc = {
.rating = 200,
.read = tcc_get_cycles,
.mask = CLOCKSOURCE_MASK(32),
- .shift = 28,
.flags = CLOCK_SOURCE_IS_CONTINUOUS,
};
@@ -103,9 +102,7 @@ static int __init tcc_clockevent_init(struct clk *clock)
{
unsigned int c = clk_get_rate(clock);
- clocksource_tcc.mult = clocksource_hz2mult(c,
- clocksource_tcc.shift);
- clocksource_register(&clocksource_tcc);
+ clocksource_register_hz(&clocksource_tcc, c);
clockevent_tcc.mult = div_sc(c, NSEC_PER_SEC,
clockevent_tcc.shift);
--
1.6.2.5
^ permalink raw reply related [flat|nested] 77+ messages in thread* [PATCH 16/40] ARM: U300: update clock source registration
2010-12-17 11:32 [PATCH 0/40] Complete set of clocksource/sched_clock patches Russell King - ARM Linux
` (14 preceding siblings ...)
2010-12-17 11:40 ` [PATCH 15/40] ARM: tcc8k: " Russell King - ARM Linux
@ 2010-12-17 11:40 ` Russell King - ARM Linux
2010-12-17 11:41 ` [PATCH 17/40] ARM: nuc: " Russell King - ARM Linux
` (32 subsequent siblings)
48 siblings, 0 replies; 77+ messages in thread
From: Russell King - ARM Linux @ 2010-12-17 11:40 UTC (permalink / raw)
To: linux-arm-kernel
In d7e81c2 (clocksource: Add clocksource_register_hz/khz interface) new
interfaces were added which simplify (and optimize) the selection of the
divisor shift/mult constants. Switch over to using this new interface.
Acked-by: Linus Walleij <linus.walleij@stericsson.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
---
arch/arm/mach-u300/timer.c | 4 +---
1 files changed, 1 insertions(+), 3 deletions(-)
diff --git a/arch/arm/mach-u300/timer.c b/arch/arm/mach-u300/timer.c
index 3fc4472..377ff7f 100644
--- a/arch/arm/mach-u300/timer.c
+++ b/arch/arm/mach-u300/timer.c
@@ -412,9 +412,7 @@ static void __init u300_timer_init(void)
writel(U300_TIMER_APP_EGPT2_TIMER_ENABLE,
U300_TIMER_APP_VBASE + U300_TIMER_APP_EGPT2);
- clocksource_calc_mult_shift(&clocksource_u300_1mhz,
- rate, APPTIMER_MIN_RANGE);
- if (clocksource_register(&clocksource_u300_1mhz))
+ if (clocksource_register_hz(&clocksource_u300_1mhz, rate))
printk(KERN_ERR "timer: failed to initialize clock "
"source %s\n", clocksource_u300_1mhz.name);
--
1.6.2.5
^ permalink raw reply related [flat|nested] 77+ messages in thread* [PATCH 17/40] ARM: nuc: update clock source registration
2010-12-17 11:32 [PATCH 0/40] Complete set of clocksource/sched_clock patches Russell King - ARM Linux
` (15 preceding siblings ...)
2010-12-17 11:40 ` [PATCH 16/40] ARM: U300: " Russell King - ARM Linux
@ 2010-12-17 11:41 ` Russell King - ARM Linux
2010-12-17 13:21 ` Wan ZongShun
2010-12-17 11:41 ` [PATCH 18/40] ARM: iop: " Russell King - ARM Linux
` (31 subsequent siblings)
48 siblings, 1 reply; 77+ messages in thread
From: Russell King - ARM Linux @ 2010-12-17 11:41 UTC (permalink / raw)
To: linux-arm-kernel
In d7e81c2 (clocksource: Add clocksource_register_hz/khz interface) new
interfaces were added which simplify (and optimize) the selection of the
divisor shift/mult constants. Switch over to using this new interface.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
---
arch/arm/mach-w90x900/time.c | 5 +----
1 files changed, 1 insertions(+), 4 deletions(-)
diff --git a/arch/arm/mach-w90x900/time.c b/arch/arm/mach-w90x900/time.c
index b80f769..4b089cb 100644
--- a/arch/arm/mach-w90x900/time.c
+++ b/arch/arm/mach-w90x900/time.c
@@ -153,7 +153,6 @@ static struct clocksource clocksource_nuc900 = {
.rating = 200,
.read = nuc900_get_cycles,
.mask = CLOCKSOURCE_MASK(TDR_SHIFT),
- .shift = 10,
.flags = CLOCK_SOURCE_IS_CONTINUOUS,
};
@@ -176,9 +175,7 @@ static void __init nuc900_clocksource_init(void)
val |= (COUNTEN | PERIOD | PRESCALE);
__raw_writel(val, REG_TCSR1);
- clocksource_nuc900.mult =
- clocksource_khz2mult((rate / 1000), clocksource_nuc900.shift);
- clocksource_register(&clocksource_nuc900);
+ clocksource_register_hz(&clocksource_nuc900, rate);
}
static void __init nuc900_timer_init(void)
--
1.6.2.5
^ permalink raw reply related [flat|nested] 77+ messages in thread* [PATCH 17/40] ARM: nuc: update clock source registration
2010-12-17 11:41 ` [PATCH 17/40] ARM: nuc: " Russell King - ARM Linux
@ 2010-12-17 13:21 ` Wan ZongShun
0 siblings, 0 replies; 77+ messages in thread
From: Wan ZongShun @ 2010-12-17 13:21 UTC (permalink / raw)
To: linux-arm-kernel
2010/12/17 Russell King - ARM Linux <linux@arm.linux.org.uk>:
> In d7e81c2 (clocksource: Add clocksource_register_hz/khz interface) new
> interfaces were added which simplify (and optimize) the selection of the
> divisor shift/mult constants. ?Switch over to using this new interface.
>
> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
> ---
> ?arch/arm/mach-w90x900/time.c | ? ?5 +----
> ?1 files changed, 1 insertions(+), 4 deletions(-)
>
> diff --git a/arch/arm/mach-w90x900/time.c b/arch/arm/mach-w90x900/time.c
> index b80f769..4b089cb 100644
> --- a/arch/arm/mach-w90x900/time.c
> +++ b/arch/arm/mach-w90x900/time.c
> @@ -153,7 +153,6 @@ static struct clocksource clocksource_nuc900 = {
> ? ? ? ?.rating = 200,
> ? ? ? ?.read ? = nuc900_get_cycles,
> ? ? ? ?.mask ? = CLOCKSOURCE_MASK(TDR_SHIFT),
> - ? ? ? .shift ?= 10,
> ? ? ? ?.flags ?= CLOCK_SOURCE_IS_CONTINUOUS,
> ?};
>
> @@ -176,9 +175,7 @@ static void __init nuc900_clocksource_init(void)
> ? ? ? ?val |= (COUNTEN | PERIOD | PRESCALE);
> ? ? ? ?__raw_writel(val, REG_TCSR1);
>
> - ? ? ? clocksource_nuc900.mult =
> - ? ? ? ? ? ? ? clocksource_khz2mult((rate / 1000), clocksource_nuc900.shift);
> - ? ? ? clocksource_register(&clocksource_nuc900);
> + ? ? ? clocksource_register_hz(&clocksource_nuc900, rate);
> ?}
>
> ?static void __init nuc900_timer_init(void)
Acked-by: Wan zongshun <mcuos.com@gmail.com>
> --
> 1.6.2.5
>
>
--
*linux-arm-kernel mailing list
mail addr:linux-arm-kernel at lists.infradead.org
you can subscribe by:
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
* linux-arm-NUC900 mailing list
mail addr:NUC900 at googlegroups.com
main web: https://groups.google.com/group/NUC900
you can subscribe it by sending me mail:
mcuos.com at gmail.com
^ permalink raw reply [flat|nested] 77+ messages in thread
* [PATCH 18/40] ARM: iop: update clock source registration
2010-12-17 11:32 [PATCH 0/40] Complete set of clocksource/sched_clock patches Russell King - ARM Linux
` (16 preceding siblings ...)
2010-12-17 11:41 ` [PATCH 17/40] ARM: nuc: " Russell King - ARM Linux
@ 2010-12-17 11:41 ` Russell King - ARM Linux
2010-12-17 11:41 ` [PATCH 19/40] ARM: mxc: " Russell King - ARM Linux
` (30 subsequent siblings)
48 siblings, 0 replies; 77+ messages in thread
From: Russell King - ARM Linux @ 2010-12-17 11:41 UTC (permalink / raw)
To: linux-arm-kernel
In d7e81c2 (clocksource: Add clocksource_register_hz/khz interface) new
interfaces were added which simplify (and optimize) the selection of the
divisor shift/mult constants. Switch over to using this new interface.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
---
arch/arm/plat-iop/time.c | 4 +---
1 files changed, 1 insertions(+), 3 deletions(-)
diff --git a/arch/arm/plat-iop/time.c b/arch/arm/plat-iop/time.c
index 85d3e55..cd6d54f 100644
--- a/arch/arm/plat-iop/time.c
+++ b/arch/arm/plat-iop/time.c
@@ -171,7 +171,5 @@ void __init iop_init_time(unsigned long tick_rate)
write_trr1(0xffffffff);
write_tcr1(0xffffffff);
write_tmr1(timer_ctl);
- clocksource_calc_mult_shift(&iop_clocksource, tick_rate,
- IOP_MIN_RANGE);
- clocksource_register(&iop_clocksource);
+ clocksource_register_hz(&iop_clocksource, tick_rate);
}
--
1.6.2.5
^ permalink raw reply related [flat|nested] 77+ messages in thread* [PATCH 19/40] ARM: mxc: update clock source registration
2010-12-17 11:32 [PATCH 0/40] Complete set of clocksource/sched_clock patches Russell King - ARM Linux
` (17 preceding siblings ...)
2010-12-17 11:41 ` [PATCH 18/40] ARM: iop: " Russell King - ARM Linux
@ 2010-12-17 11:41 ` Russell King - ARM Linux
2010-12-17 11:44 ` [PATCH 20/40] ARM: nomadik: " Russell King - ARM Linux
` (29 subsequent siblings)
48 siblings, 0 replies; 77+ messages in thread
From: Russell King - ARM Linux @ 2010-12-17 11:41 UTC (permalink / raw)
To: linux-arm-kernel
In d7e81c2 (clocksource: Add clocksource_register_hz/khz interface) new
interfaces were added which simplify (and optimize) the selection of the
divisor shift/mult constants. Switch over to using this new interface.
Acked-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
---
arch/arm/plat-mxc/epit.c | 5 +----
arch/arm/plat-mxc/time.c | 5 +----
2 files changed, 2 insertions(+), 8 deletions(-)
diff --git a/arch/arm/plat-mxc/epit.c b/arch/arm/plat-mxc/epit.c
index ee9582f..d69d343 100644
--- a/arch/arm/plat-mxc/epit.c
+++ b/arch/arm/plat-mxc/epit.c
@@ -93,7 +93,6 @@ static struct clocksource clocksource_epit = {
.rating = 200,
.read = epit_read,
.mask = CLOCKSOURCE_MASK(32),
- .shift = 20,
.flags = CLOCK_SOURCE_IS_CONTINUOUS,
};
@@ -101,9 +100,7 @@ static int __init epit_clocksource_init(struct clk *timer_clk)
{
unsigned int c = clk_get_rate(timer_clk);
- clocksource_epit.mult = clocksource_hz2mult(c,
- clocksource_epit.shift);
- clocksource_register(&clocksource_epit);
+ clocksource_register_hz(&clocksource_epit, c);
return 0;
}
diff --git a/arch/arm/plat-mxc/time.c b/arch/arm/plat-mxc/time.c
index f9a1b05..9f0c261 100644
--- a/arch/arm/plat-mxc/time.c
+++ b/arch/arm/plat-mxc/time.c
@@ -120,7 +120,6 @@ static struct clocksource clocksource_mxc = {
.rating = 200,
.read = mx1_2_get_cycles,
.mask = CLOCKSOURCE_MASK(32),
- .shift = 20,
.flags = CLOCK_SOURCE_IS_CONTINUOUS,
};
@@ -131,9 +130,7 @@ static int __init mxc_clocksource_init(struct clk *timer_clk)
if (timer_is_v2())
clocksource_mxc.read = v2_get_cycles;
- clocksource_mxc.mult = clocksource_hz2mult(c,
- clocksource_mxc.shift);
- clocksource_register(&clocksource_mxc);
+ clocksource_register_hz(&clocksource_mxc, c);
return 0;
}
--
1.6.2.5
^ permalink raw reply related [flat|nested] 77+ messages in thread* [PATCH 20/40] ARM: nomadik: update clock source registration
2010-12-17 11:32 [PATCH 0/40] Complete set of clocksource/sched_clock patches Russell King - ARM Linux
` (18 preceding siblings ...)
2010-12-17 11:41 ` [PATCH 19/40] ARM: mxc: " Russell King - ARM Linux
@ 2010-12-17 11:44 ` Russell King - ARM Linux
2010-12-17 11:44 ` [PATCH 21/40] ARM: spear: " Russell King - ARM Linux
` (28 subsequent siblings)
48 siblings, 0 replies; 77+ messages in thread
From: Russell King - ARM Linux @ 2010-12-17 11:44 UTC (permalink / raw)
To: linux-arm-kernel
In d7e81c2 (clocksource: Add clocksource_register_hz/khz interface) new
interfaces were added which simplify (and optimize) the selection of the
divisor shift/mult constants. Switch over to using this new interface.
Acked-by: Linus Walleij <linus.walleij@stericsson.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
---
arch/arm/plat-nomadik/timer.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/arch/arm/plat-nomadik/timer.c b/arch/arm/plat-nomadik/timer.c
index 63cdc60..b0bd6df 100644
--- a/arch/arm/plat-nomadik/timer.c
+++ b/arch/arm/plat-nomadik/timer.c
@@ -222,7 +222,6 @@ void __init nmdk_timer_init(void)
} else {
cr |= MTU_CRn_PRESCALE_1;
}
- clocksource_calc_mult_shift(&nmdk_clksrc, rate, MTU_MIN_RANGE);
/* Timer 0 is the free running clocksource */
writel(cr, mtu_base + MTU_CR(0));
@@ -233,7 +232,7 @@ void __init nmdk_timer_init(void)
/* Now the clock source is ready */
nmdk_clksrc.read = nmdk_read_timer;
- if (clocksource_register(&nmdk_clksrc))
+ if (clocksource_register_hz(&nmdk_clksrc, rate))
pr_err("timer: failed to initialize clock source %s\n",
nmdk_clksrc.name);
--
1.6.2.5
^ permalink raw reply related [flat|nested] 77+ messages in thread* [PATCH 21/40] ARM: spear: update clock source registration
2010-12-17 11:32 [PATCH 0/40] Complete set of clocksource/sched_clock patches Russell King - ARM Linux
` (19 preceding siblings ...)
2010-12-17 11:44 ` [PATCH 20/40] ARM: nomadik: " Russell King - ARM Linux
@ 2010-12-17 11:44 ` Russell King - ARM Linux
2010-12-17 11:45 ` [PATCH 22/40] ARM: orion: " Russell King - ARM Linux
` (27 subsequent siblings)
48 siblings, 0 replies; 77+ messages in thread
From: Russell King - ARM Linux @ 2010-12-17 11:44 UTC (permalink / raw)
To: linux-arm-kernel
In d7e81c2 (clocksource: Add clocksource_register_hz/khz interface) new
interfaces were added which simplify (and optimize) the selection of the
divisor shift/mult constants. Switch over to using this new interface.
Acked-by: Viresh Kumar <viresh.kumar@st.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
---
arch/arm/plat-spear/time.c | 6 +-----
1 files changed, 1 insertions(+), 5 deletions(-)
diff --git a/arch/arm/plat-spear/time.c b/arch/arm/plat-spear/time.c
index ab21165..839c88d 100644
--- a/arch/arm/plat-spear/time.c
+++ b/arch/arm/plat-spear/time.c
@@ -81,8 +81,6 @@ static struct clocksource clksrc = {
.rating = 200, /* its a pretty decent clock */
.read = clocksource_read_cycles,
.mask = 0xFFFF, /* 16 bits */
- .mult = 0, /* to be computed */
- .shift = 0, /* to be computed */
.flags = CLOCK_SOURCE_IS_CONTINUOUS,
};
@@ -105,10 +103,8 @@ static void spear_clocksource_init(void)
val |= CTRL_ENABLE ;
writew(val, gpt_base + CR(CLKSRC));
- clocksource_calc_mult_shift(&clksrc, tick_rate, SPEAR_MIN_RANGE);
-
/* register the clocksource */
- clocksource_register(&clksrc);
+ clocksource_register_hz(&clksrc, tick_rate);
}
static struct clock_event_device clkevt = {
--
1.6.2.5
^ permalink raw reply related [flat|nested] 77+ messages in thread* [PATCH 22/40] ARM: orion: update clock source registration
2010-12-17 11:32 [PATCH 0/40] Complete set of clocksource/sched_clock patches Russell King - ARM Linux
` (20 preceding siblings ...)
2010-12-17 11:44 ` [PATCH 21/40] ARM: spear: " Russell King - ARM Linux
@ 2010-12-17 11:45 ` Russell King - ARM Linux
2010-12-17 11:46 ` [PATCH 23/40] ARM: stmp: " Russell King - ARM Linux
` (26 subsequent siblings)
48 siblings, 0 replies; 77+ messages in thread
From: Russell King - ARM Linux @ 2010-12-17 11:45 UTC (permalink / raw)
To: linux-arm-kernel
In d7e81c2 (clocksource: Add clocksource_register_hz/khz interface) new
interfaces were added which simplify (and optimize) the selection of the
divisor shift/mult constants. Switch over to using this new interface.
Acked-by: Nicolas Pitre <nico@fluxnic.net>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
---
arch/arm/plat-orion/time.c | 4 +---
1 files changed, 1 insertions(+), 3 deletions(-)
diff --git a/arch/arm/plat-orion/time.c b/arch/arm/plat-orion/time.c
index 715a301..11e2583 100644
--- a/arch/arm/plat-orion/time.c
+++ b/arch/arm/plat-orion/time.c
@@ -102,7 +102,6 @@ static cycle_t orion_clksrc_read(struct clocksource *cs)
static struct clocksource orion_clksrc = {
.name = "orion_clocksource",
- .shift = 20,
.rating = 300,
.read = orion_clksrc_read,
.mask = CLOCKSOURCE_MASK(32),
@@ -245,8 +244,7 @@ void __init orion_time_init(unsigned int irq, unsigned int tclk)
writel(u & ~BRIDGE_INT_TIMER0, BRIDGE_MASK);
u = readl(TIMER_CTRL);
writel(u | TIMER0_EN | TIMER0_RELOAD_EN, TIMER_CTRL);
- orion_clksrc.mult = clocksource_hz2mult(tclk, orion_clksrc.shift);
- clocksource_register(&orion_clksrc);
+ clocksource_register_hz(&orion_clksrc, tclk);
/*
* Setup clockevent timer (interrupt-driven.)
--
1.6.2.5
^ permalink raw reply related [flat|nested] 77+ messages in thread* [PATCH 23/40] ARM: stmp: update clock source registration
2010-12-17 11:32 [PATCH 0/40] Complete set of clocksource/sched_clock patches Russell King - ARM Linux
` (21 preceding siblings ...)
2010-12-17 11:45 ` [PATCH 22/40] ARM: orion: " Russell King - ARM Linux
@ 2010-12-17 11:46 ` Russell King - ARM Linux
2010-12-17 11:46 ` [PATCH 24/40] ARM: realview/versatile: " Russell King - ARM Linux
` (25 subsequent siblings)
48 siblings, 0 replies; 77+ messages in thread
From: Russell King - ARM Linux @ 2010-12-17 11:46 UTC (permalink / raw)
To: linux-arm-kernel
In d7e81c2 (clocksource: Add clocksource_register_hz/khz interface) new
interfaces were added which simplify (and optimize) the selection of the
divisor shift/mult constants. Switch over to using this new interface.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
---
arch/arm/plat-stmp3xxx/timer.c | 5 +----
1 files changed, 1 insertions(+), 4 deletions(-)
diff --git a/arch/arm/plat-stmp3xxx/timer.c b/arch/arm/plat-stmp3xxx/timer.c
index 063c7bc..c395630 100644
--- a/arch/arm/plat-stmp3xxx/timer.c
+++ b/arch/arm/plat-stmp3xxx/timer.c
@@ -89,7 +89,6 @@ static struct clocksource cksrc_stmp3xxx = {
.rating = 250,
.read = stmp3xxx_clock_read,
.mask = CLOCKSOURCE_MASK(16),
- .shift = 10,
.flags = CLOCK_SOURCE_IS_CONTINUOUS,
};
@@ -106,8 +105,6 @@ static struct irqaction stmp3xxx_timer_irq = {
*/
static void __init stmp3xxx_init_timer(void)
{
- cksrc_stmp3xxx.mult = clocksource_hz2mult(CLOCK_TICK_RATE,
- cksrc_stmp3xxx.shift);
ckevt_timrot.mult = div_sc(CLOCK_TICK_RATE, NSEC_PER_SEC,
ckevt_timrot.shift);
ckevt_timrot.min_delta_ns = clockevent_delta2ns(2, &ckevt_timrot);
@@ -140,7 +137,7 @@ static void __init stmp3xxx_init_timer(void)
setup_irq(IRQ_TIMER0, &stmp3xxx_timer_irq);
- clocksource_register(&cksrc_stmp3xxx);
+ clocksource_register_hz(&cksrc_stmp3xxx, CLOCK_TICK_RATE);
clockevents_register_device(&ckevt_timrot);
}
--
1.6.2.5
^ permalink raw reply related [flat|nested] 77+ messages in thread* [PATCH 24/40] ARM: realview/versatile: update clock source registration
2010-12-17 11:32 [PATCH 0/40] Complete set of clocksource/sched_clock patches Russell King - ARM Linux
` (22 preceding siblings ...)
2010-12-17 11:46 ` [PATCH 23/40] ARM: stmp: " Russell King - ARM Linux
@ 2010-12-17 11:46 ` Russell King - ARM Linux
2010-12-17 11:46 ` [PATCH 25/40] ARM: tegra: timer: Separate clocksource and sched_clock Russell King - ARM Linux
` (24 subsequent siblings)
48 siblings, 0 replies; 77+ messages in thread
From: Russell King - ARM Linux @ 2010-12-17 11:46 UTC (permalink / raw)
To: linux-arm-kernel
In d7e81c2 (clocksource: Add clocksource_register_hz/khz interface) new
interfaces were added which simplify (and optimize) the selection of the
divisor shift/mult constants. Switch over to using this new interface.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
---
arch/arm/plat-versatile/timer-sp.c | 4 +---
1 files changed, 1 insertions(+), 3 deletions(-)
diff --git a/arch/arm/plat-versatile/timer-sp.c b/arch/arm/plat-versatile/timer-sp.c
index fb0d1c2..f09941b 100644
--- a/arch/arm/plat-versatile/timer-sp.c
+++ b/arch/arm/plat-versatile/timer-sp.c
@@ -46,7 +46,6 @@ static struct clocksource clocksource_sp804 = {
.rating = 200,
.read = sp804_read,
.mask = CLOCKSOURCE_MASK(32),
- .shift = 20,
.flags = CLOCK_SOURCE_IS_CONTINUOUS,
};
@@ -63,8 +62,7 @@ void __init sp804_clocksource_init(void __iomem *base)
writel(TIMER_CTRL_32BIT | TIMER_CTRL_ENABLE | TIMER_CTRL_PERIODIC,
clksrc_base + TIMER_CTRL);
- cs->mult = clocksource_khz2mult(TIMER_FREQ_KHZ, cs->shift);
- clocksource_register(cs);
+ clocksource_register_khz(cs, TIMER_FREQ_KHZ);
}
--
1.6.2.5
^ permalink raw reply related [flat|nested] 77+ messages in thread* [PATCH 25/40] ARM: tegra: timer: Separate clocksource and sched_clock
2010-12-17 11:32 [PATCH 0/40] Complete set of clocksource/sched_clock patches Russell King - ARM Linux
` (23 preceding siblings ...)
2010-12-17 11:46 ` [PATCH 24/40] ARM: realview/versatile: " Russell King - ARM Linux
@ 2010-12-17 11:46 ` Russell King - ARM Linux
2010-12-17 11:47 ` [PATCH 26/40] ARM: ensure all sched_clock() implementations are notrace marked Russell King - ARM Linux
` (23 subsequent siblings)
48 siblings, 0 replies; 77+ messages in thread
From: Russell King - ARM Linux @ 2010-12-17 11:46 UTC (permalink / raw)
To: linux-arm-kernel
tegra_clocksource_read should not use cnt32_to_63, wrapping is
already handled in the clocksource code. Move the cnt32_to_63
into the sched_clock function, and replace the use of clocksource
mult and shift with a multiplication by 1000 to convert us to ns.
Acked-by: John Stultz <johnstul@us.ibm.com>
Acked-by: Linus Walleij <linus.walleij@stericsson.com>
Signed-off-by: Colin Cross <ccross@android.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
---
arch/arm/mach-tegra/timer.c | 7 +++----
1 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/arch/arm/mach-tegra/timer.c b/arch/arm/mach-tegra/timer.c
index 9057d6f..b49f2f5 100644
--- a/arch/arm/mach-tegra/timer.c
+++ b/arch/arm/mach-tegra/timer.c
@@ -91,7 +91,7 @@ static void tegra_timer_set_mode(enum clock_event_mode mode,
static cycle_t tegra_clocksource_read(struct clocksource *cs)
{
- return cnt32_to_63(timer_readl(TIMERUS_CNTR_1US));
+ return timer_readl(TIMERUS_CNTR_1US);
}
static struct clock_event_device tegra_clockevent = {
@@ -106,14 +106,13 @@ static struct clocksource tegra_clocksource = {
.name = "timer_us",
.rating = 300,
.read = tegra_clocksource_read,
- .mask = 0x7FFFFFFFFFFFFFFFULL,
+ .mask = CLOCKSOURCE_MASK(32),
.flags = CLOCK_SOURCE_IS_CONTINUOUS,
};
unsigned long long sched_clock(void)
{
- return clocksource_cyc2ns(tegra_clocksource.read(&tegra_clocksource),
- tegra_clocksource.mult, tegra_clocksource.shift);
+ return cnt32_to_63(timer_readl(TIMERUS_CNTR_1US)) * 1000;
}
static irqreturn_t tegra_timer_interrupt(int irq, void *dev_id)
--
1.6.2.5
^ permalink raw reply related [flat|nested] 77+ messages in thread* [PATCH 26/40] ARM: ensure all sched_clock() implementations are notrace marked
2010-12-17 11:32 [PATCH 0/40] Complete set of clocksource/sched_clock patches Russell King - ARM Linux
` (24 preceding siblings ...)
2010-12-17 11:46 ` [PATCH 25/40] ARM: tegra: timer: Separate clocksource and sched_clock Russell King - ARM Linux
@ 2010-12-17 11:47 ` Russell King - ARM Linux
2010-12-17 11:47 ` [PATCH 27/40] Fix rounding in clocks_calc_mult_shift() Russell King - ARM Linux
` (22 subsequent siblings)
48 siblings, 0 replies; 77+ messages in thread
From: Russell King - ARM Linux @ 2010-12-17 11:47 UTC (permalink / raw)
To: linux-arm-kernel
ftrace requires sched_clock() to be notrace. Ensure that all
implementations are so marked. Also make sure that they include
linux/sched.h
Also ensure OMAP clocksource read functions are marked notrace as
they're used for sched_clock() too.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
---
arch/arm/mach-ixp4xx/common.c | 2 +-
arch/arm/mach-mmp/time.c | 2 +-
arch/arm/mach-pxa/time.c | 2 +-
arch/arm/mach-sa1100/generic.c | 2 +-
arch/arm/mach-tegra/timer.c | 3 ++-
arch/arm/mach-u300/timer.c | 1 +
arch/arm/plat-iop/time.c | 3 ++-
arch/arm/plat-nomadik/timer.c | 1 +
arch/arm/plat-omap/counter_32k.c | 15 ++++++++-------
arch/arm/plat-orion/time.c | 2 +-
arch/arm/plat-versatile/sched-clock.c | 2 +-
11 files changed, 20 insertions(+), 15 deletions(-)
diff --git a/arch/arm/mach-ixp4xx/common.c b/arch/arm/mach-ixp4xx/common.c
index 82fc003..e0b91d8 100644
--- a/arch/arm/mach-ixp4xx/common.c
+++ b/arch/arm/mach-ixp4xx/common.c
@@ -424,7 +424,7 @@ static void __init ixp4xx_clocksource_init(void)
/*
* sched_clock()
*/
-unsigned long long sched_clock(void)
+unsigned long long notrace sched_clock(void)
{
cycle_t cyc = ixp4xx_get_cycles(NULL);
struct clocksource *cs = &clocksource_ixp4xx;
diff --git a/arch/arm/mach-mmp/time.c b/arch/arm/mach-mmp/time.c
index 0c0ab09..a2ea33d 100644
--- a/arch/arm/mach-mmp/time.c
+++ b/arch/arm/mach-mmp/time.c
@@ -75,7 +75,7 @@ static inline uint32_t timer_read(void)
return __raw_readl(TIMERS_VIRT_BASE + TMR_CVWR(0));
}
-unsigned long long sched_clock(void)
+unsigned long long notrace sched_clock(void)
{
unsigned long long v = cnt32_to_63(timer_read());
return (v * tcr2ns_scale) >> TCR2NS_SCALE_FACTOR;
diff --git a/arch/arm/mach-pxa/time.c b/arch/arm/mach-pxa/time.c
index caf92c0..b8d9dff 100644
--- a/arch/arm/mach-pxa/time.c
+++ b/arch/arm/mach-pxa/time.c
@@ -51,7 +51,7 @@ static void __init set_oscr2ns_scale(unsigned long oscr_rate)
oscr2ns_scale++;
}
-unsigned long long sched_clock(void)
+unsigned long long notrace sched_clock(void)
{
unsigned long long v = cnt32_to_63(OSCR);
return (v * oscr2ns_scale) >> OSCR2NS_SCALE_FACTOR;
diff --git a/arch/arm/mach-sa1100/generic.c b/arch/arm/mach-sa1100/generic.c
index 3c1fcd6..33b4969 100644
--- a/arch/arm/mach-sa1100/generic.c
+++ b/arch/arm/mach-sa1100/generic.c
@@ -119,7 +119,7 @@ unsigned int sa11x0_getspeed(unsigned int cpu)
*
* ( * 1E9 / 3686400 => * 78125 / 288)
*/
-unsigned long long sched_clock(void)
+unsigned long long notrace sched_clock(void)
{
unsigned long long v = cnt32_to_63(OSCR);
diff --git a/arch/arm/mach-tegra/timer.c b/arch/arm/mach-tegra/timer.c
index b49f2f5..c52bd84 100644
--- a/arch/arm/mach-tegra/timer.c
+++ b/arch/arm/mach-tegra/timer.c
@@ -18,6 +18,7 @@
*/
#include <linux/init.h>
+#include <linux/sched.h>
#include <linux/time.h>
#include <linux/interrupt.h>
#include <linux/irq.h>
@@ -110,7 +111,7 @@ static struct clocksource tegra_clocksource = {
.flags = CLOCK_SOURCE_IS_CONTINUOUS,
};
-unsigned long long sched_clock(void)
+unsigned long long notrace sched_clock(void)
{
return cnt32_to_63(timer_readl(TIMERUS_CNTR_1US)) * 1000;
}
diff --git a/arch/arm/mach-u300/timer.c b/arch/arm/mach-u300/timer.c
index 377ff7f..6c68fe7 100644
--- a/arch/arm/mach-u300/timer.c
+++ b/arch/arm/mach-u300/timer.c
@@ -9,6 +9,7 @@
* Author: Linus Walleij <linus.walleij@stericsson.com>
*/
#include <linux/interrupt.h>
+#include <linux/sched.h>
#include <linux/time.h>
#include <linux/timex.h>
#include <linux/clockchips.h>
diff --git a/arch/arm/plat-iop/time.c b/arch/arm/plat-iop/time.c
index cd6d54f..0c6da54 100644
--- a/arch/arm/plat-iop/time.c
+++ b/arch/arm/plat-iop/time.c
@@ -17,6 +17,7 @@
#include <linux/interrupt.h>
#include <linux/time.h>
#include <linux/init.h>
+#include <linux/sched.h>
#include <linux/timex.h>
#include <linux/io.h>
#include <linux/clocksource.h>
@@ -52,7 +53,7 @@ static struct clocksource iop_clocksource = {
/*
* IOP sched_clock() implementation via its clocksource.
*/
-unsigned long long sched_clock(void)
+unsigned long long notrace sched_clock(void)
{
cycle_t cyc = iop_clocksource_read(NULL);
struct clocksource *cs = &iop_clocksource;
diff --git a/arch/arm/plat-nomadik/timer.c b/arch/arm/plat-nomadik/timer.c
index b0bd6df..c3b8a22 100644
--- a/arch/arm/plat-nomadik/timer.c
+++ b/arch/arm/plat-nomadik/timer.c
@@ -19,6 +19,7 @@
#include <linux/err.h>
#include <linux/cnt32_to_63.h>
#include <linux/timer.h>
+#include <linux/sched.h>
#include <asm/mach/time.h>
#include <plat/mtu.h>
diff --git a/arch/arm/plat-omap/counter_32k.c b/arch/arm/plat-omap/counter_32k.c
index 8f149f5..aed301b 100644
--- a/arch/arm/plat-omap/counter_32k.c
+++ b/arch/arm/plat-omap/counter_32k.c
@@ -16,6 +16,7 @@
#include <linux/init.h>
#include <linux/clk.h>
#include <linux/io.h>
+#include <linux/sched.h>
#include <plat/common.h>
#include <plat/board.h>
@@ -44,7 +45,7 @@
static u32 offset_32k __read_mostly;
#ifdef CONFIG_ARCH_OMAP16XX
-static cycle_t omap16xx_32k_read(struct clocksource *cs)
+static cycle_t notrace omap16xx_32k_read(struct clocksource *cs)
{
return omap_readl(OMAP16XX_TIMER_32K_SYNCHRONIZED) - offset_32k;
}
@@ -53,7 +54,7 @@ static cycle_t omap16xx_32k_read(struct clocksource *cs)
#endif
#ifdef CONFIG_ARCH_OMAP2420
-static cycle_t omap2420_32k_read(struct clocksource *cs)
+static cycle_t notrace omap2420_32k_read(struct clocksource *cs)
{
return omap_readl(OMAP2420_32KSYNCT_BASE + 0x10) - offset_32k;
}
@@ -62,7 +63,7 @@ static cycle_t omap2420_32k_read(struct clocksource *cs)
#endif
#ifdef CONFIG_ARCH_OMAP2430
-static cycle_t omap2430_32k_read(struct clocksource *cs)
+static cycle_t notrace omap2430_32k_read(struct clocksource *cs)
{
return omap_readl(OMAP2430_32KSYNCT_BASE + 0x10) - offset_32k;
}
@@ -71,7 +72,7 @@ static cycle_t omap2430_32k_read(struct clocksource *cs)
#endif
#ifdef CONFIG_ARCH_OMAP3
-static cycle_t omap34xx_32k_read(struct clocksource *cs)
+static cycle_t notrace omap34xx_32k_read(struct clocksource *cs)
{
return omap_readl(OMAP3430_32KSYNCT_BASE + 0x10) - offset_32k;
}
@@ -80,7 +81,7 @@ static cycle_t omap34xx_32k_read(struct clocksource *cs)
#endif
#ifdef CONFIG_ARCH_OMAP4
-static cycle_t omap44xx_32k_read(struct clocksource *cs)
+static cycle_t notrace omap44xx_32k_read(struct clocksource *cs)
{
return omap_readl(OMAP4430_32KSYNCT_BASE + 0x10) - offset_32k;
}
@@ -92,7 +93,7 @@ static cycle_t omap44xx_32k_read(struct clocksource *cs)
* Kernel assumes that sched_clock can be called early but may not have
* things ready yet.
*/
-static cycle_t omap_32k_read_dummy(struct clocksource *cs)
+static cycle_t notrace omap_32k_read_dummy(struct clocksource *cs)
{
return 0;
}
@@ -109,7 +110,7 @@ static struct clocksource clocksource_32k = {
* Returns current time from boot in nsecs. It's OK for this to wrap
* around for now, as it's just a relative time stamp.
*/
-unsigned long long sched_clock(void)
+unsigned long long notrace sched_clock(void)
{
return clocksource_cyc2ns(clocksource_32k.read(&clocksource_32k),
clocksource_32k.mult, clocksource_32k.shift);
diff --git a/arch/arm/plat-orion/time.c b/arch/arm/plat-orion/time.c
index 11e2583..123f96f 100644
--- a/arch/arm/plat-orion/time.c
+++ b/arch/arm/plat-orion/time.c
@@ -55,7 +55,7 @@ static u32 ticks_per_jiffy;
static unsigned long tclk2ns_scale;
-unsigned long long sched_clock(void)
+unsigned long long notrace sched_clock(void)
{
unsigned long long v = cnt32_to_63(0xffffffff - readl(TIMER0_VAL));
return (v * tclk2ns_scale) >> TCLK2NS_SCALE_FACTOR;
diff --git a/arch/arm/plat-versatile/sched-clock.c b/arch/arm/plat-versatile/sched-clock.c
index 9696ddc..42efd14 100644
--- a/arch/arm/plat-versatile/sched-clock.c
+++ b/arch/arm/plat-versatile/sched-clock.c
@@ -42,7 +42,7 @@
* long as there is always less than 89 seconds between successive
* calls to this function.
*/
-unsigned long long sched_clock(void)
+unsigned long long notrace sched_clock(void)
{
unsigned long long v = cnt32_to_63(readl(REFCOUNTER));
--
1.6.2.5
^ permalink raw reply related [flat|nested] 77+ messages in thread* [PATCH 27/40] Fix rounding in clocks_calc_mult_shift()
2010-12-17 11:32 [PATCH 0/40] Complete set of clocksource/sched_clock patches Russell King - ARM Linux
` (25 preceding siblings ...)
2010-12-17 11:47 ` [PATCH 26/40] ARM: ensure all sched_clock() implementations are notrace marked Russell King - ARM Linux
@ 2010-12-17 11:47 ` Russell King - ARM Linux
2010-12-17 11:47 ` [PATCH 28/40] ARM: sched_clock: provide common infrastructure for sched_clock() Russell King - ARM Linux
` (21 subsequent siblings)
48 siblings, 0 replies; 77+ messages in thread
From: Russell King - ARM Linux @ 2010-12-17 11:47 UTC (permalink / raw)
To: linux-arm-kernel
Russell King reports:
| On the ARM dev boards, we have a 32-bit counter running at 24MHz. Calling
| clocks_calc_mult_shift(&mult, &shift, 24MHz, NSEC_PER_SEC, 60) gives
| us a multiplier of 2796202666 and a shift of 26.
|
| Over a large counter delta, this produces an error - lets take a count
| from 362976315 to 4280663372:
|
| (4280663372-362976315) * 2796202666 / 2^26 - (4280663372-362976315) * (1000/24)
| => -38.91872422891230269990
|
| Can we do better?
|
| (4280663372-362976315) * 2796202667 / 2^26 - (4280663372-362976315) * (1000/24)
| 19.45936211449532822051
|
| which is about twice as good as the 2796202666 multiplier.
|
| Looking at the equivalent divisions obtained, 2796202666 / 2^26 gives
| 41.66666665673255920410ns per tick, whereas 2796202667 / 2^26 gives
| 41.66666667163372039794ns. The actual value wanted is 1000/24 =
| 41.66666666666666666666ns.
Fix this by ensuring we round to nearest when calculating the
multiplier.
Signed-off-by: John Stultz <john.stultz@linaro.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
---
kernel/time/clocksource.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/kernel/time/clocksource.c b/kernel/time/clocksource.c
index c18d7ef..df140cd 100644
--- a/kernel/time/clocksource.c
+++ b/kernel/time/clocksource.c
@@ -152,6 +152,7 @@ clocks_calc_mult_shift(u32 *mult, u32 *shift, u32 from, u32 to, u32 minsec)
*/
for (sft = 32; sft > 0; sft--) {
tmp = (u64) to << sft;
+ tmp += from / 2;
do_div(tmp, from);
if ((tmp >> sftacc) == 0)
break;
--
1.6.2.5
^ permalink raw reply related [flat|nested] 77+ messages in thread* [PATCH 28/40] ARM: sched_clock: provide common infrastructure for sched_clock()
2010-12-17 11:32 [PATCH 0/40] Complete set of clocksource/sched_clock patches Russell King - ARM Linux
` (26 preceding siblings ...)
2010-12-17 11:47 ` [PATCH 27/40] Fix rounding in clocks_calc_mult_shift() Russell King - ARM Linux
@ 2010-12-17 11:47 ` Russell King - ARM Linux
2010-12-17 18:51 ` Nicolas Pitre
2010-12-17 11:48 ` [PATCH 29/40] ARM: ixp4xx: convert sched_clock() to use new infrastructure Russell King - ARM Linux
` (20 subsequent siblings)
48 siblings, 1 reply; 77+ messages in thread
From: Russell King - ARM Linux @ 2010-12-17 11:47 UTC (permalink / raw)
To: linux-arm-kernel
Provide common sched_clock() infrastructure for platforms to use to
create a 64-bit ns based sched_clock() implementation from a counter
running at a non-variable clock rate.
This implementation is based upon maintaining an epoch for the counter
and an epoch for the nanosecond time. When we desire a sched_clock()
time, we calculate the number of counter ticks since the last epoch
update, convert this to nanoseconds and add to the epoch nanoseconds.
We regularly refresh these epochs within the counter wrap interval.
We perform a similar calculation as above, and store the new epochs.
We read and write the epochs in such a way that sched_clock() can easily
(and locklessly) detect when an update is in progress, and repeat the
loading of these constants when they're known not to be stable. The
one caveat is that sched_clock() is not called in the middle of an
update.
Finally, if the clock rate is known at compile time, the counter to ns
conversion factors can be specified, allowing sched_clock() to be tightly
optimized. We ensure that these factors are correct by providing an
initialization function which performs a run-time check.
Acked-by: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
---
arch/arm/Kconfig | 3 +
arch/arm/include/asm/sched_clock.h | 115 ++++++++++++++++++++++++++++++++++++
arch/arm/kernel/Makefile | 1 +
arch/arm/kernel/sched_clock.c | 69 +++++++++++++++++++++
4 files changed, 188 insertions(+), 0 deletions(-)
create mode 100644 arch/arm/include/asm/sched_clock.h
create mode 100644 arch/arm/kernel/sched_clock.c
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 49778bb..ed7a0a7 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -38,6 +38,9 @@ config HAVE_PWM
config SYS_SUPPORTS_APM_EMULATION
bool
+config HAVE_SCHED_CLOCK
+ bool
+
config GENERIC_GPIO
bool
diff --git a/arch/arm/include/asm/sched_clock.h b/arch/arm/include/asm/sched_clock.h
new file mode 100644
index 0000000..82d4d3f
--- /dev/null
+++ b/arch/arm/include/asm/sched_clock.h
@@ -0,0 +1,115 @@
+/*
+ * sched_clock.h: support for extending counters to full 64-bit ns counter
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+#ifndef ASM_SCHED_CLOCK
+#define ASM_SCHED_CLOCK
+
+#include <linux/kernel.h>
+#include <linux/types.h>
+
+struct clock_data {
+ u64 epoch_ns;
+ u32 epoch_cyc;
+ u32 epoch_cyc_copy;
+ u32 mult;
+ u32 shift;
+};
+
+#define DEFINE_CLOCK_DATA(name) struct clock_data name
+
+static inline u64 cyc_to_ns(u64 cyc, u32 mult, u32 shift)
+{
+ return (cyc * mult) >> shift;
+}
+
+/*
+ * Atomically update the sched_clock epoch. Your update callback will
+ * be called from a timer before the counter wraps - read the current
+ * counter value, and call this function to safely move the epochs
+ * forward.
+ */
+static inline void update_sched_clock(struct clock_data *cd, u32 cyc, u32 mask)
+{
+ u64 ns = cd->epoch_ns +
+ cyc_to_ns((cyc - cd->epoch_cyc) & mask, cd->mult, cd->shift);
+
+ /*
+ * Write epoch_cyc and epoch_ns in a way that the update is
+ * detectable in cyc_to_fixed_sched_clock().
+ */
+ cd->epoch_cyc = cyc;
+ smp_wmb();
+ cd->epoch_ns = ns;
+ smp_wmb();
+ cd->epoch_cyc_copy = cyc;
+}
+
+/*
+ * If your clock rate is known at compile time, using this will allow
+ * you to optimize the mult/shift loads away. This is paired with
+ * init_fixed_sched_clock() to ensure that your mult/shift are correct.
+ */
+static inline unsigned long long cyc_to_fixed_sched_clock(struct clock_data *cd,
+ u32 cyc, u32 mask, u32 mult, u32 shift)
+{
+ u64 epoch_ns;
+ u32 epoch_cyc;
+
+ /*
+ * Load the epoch_cyc and epoch_ns atomically. We do this by
+ * ensuring that we always write epoch_cyc, epoch_ns and
+ * epoch_cyc_copy in strict order, and read them in strict order.
+ * If epoch_cyc and epoch_cyc_copy are not equal, then we're in
+ * the middle of an update, and we should repeat the load.
+ */
+ do {
+ epoch_cyc = cd->epoch_cyc;
+ smp_rmb();
+ epoch_ns = cd->epoch_ns;
+ smp_rmb();
+ } while (epoch_cyc != cd->epoch_cyc_copy);
+
+ return epoch_ns + cyc_to_ns((cyc - epoch_cyc) & mask, mult, shift);
+}
+
+/*
+ * Otherwise, you need to use this, which will obtain the mult/shift
+ * from the clock_data structure. Use init_sched_clock() with this.
+ */
+static inline unsigned long long cyc_to_sched_clock(struct clock_data *cd,
+ u32 cyc, u32 mask)
+{
+ return cyc_to_fixed_sched_clock(cd, cyc, mask, cd->mult, cd->shift);
+}
+
+/*
+ * Initialize the clock data - calculate the appropriate multiplier
+ * and shift. Also setup a timer to ensure that the epoch is refreshed
+ * at the appropriate time interval, which will call your update
+ * handler.
+ */
+void init_sched_clock(struct clock_data *, void (*)(void),
+ unsigned int, unsigned long);
+
+/*
+ * Use this initialization function rather than init_sched_clock() if
+ * you're using cyc_to_fixed_sched_clock, which will warn if your
+ * constants are incorrect.
+ */
+static inline void init_fixed_sched_clock(struct clock_data *cd,
+ void (*update)(void), unsigned int bits, unsigned long rate,
+ u32 mult, u32 shift)
+{
+ init_sched_clock(cd, update, bits, rate);
+ if (cd->mult != mult || cd->shift != shift) {
+ pr_crit("sched_clock: wrong multiply/shift: %u>>%u vs calculated %u>>%u\n"
+ "sched_clock: fix multiply/shift to avoid scheduler hiccups\n",
+ mult, shift, cd->mult, cd->shift);
+ }
+}
+
+#endif
diff --git a/arch/arm/kernel/Makefile b/arch/arm/kernel/Makefile
index 679851a..fd3ec49 100644
--- a/arch/arm/kernel/Makefile
+++ b/arch/arm/kernel/Makefile
@@ -29,6 +29,7 @@ obj-$(CONFIG_MODULES) += armksyms.o module.o
obj-$(CONFIG_ARTHUR) += arthur.o
obj-$(CONFIG_ISA_DMA) += dma-isa.o
obj-$(CONFIG_PCI) += bios32.o isa.o
+obj-$(CONFIG_HAVE_SCHED_CLOCK) += sched_clock.o
obj-$(CONFIG_SMP) += smp.o
obj-$(CONFIG_HAVE_ARM_SCU) += smp_scu.o
obj-$(CONFIG_HAVE_ARM_TWD) += smp_twd.o
diff --git a/arch/arm/kernel/sched_clock.c b/arch/arm/kernel/sched_clock.c
new file mode 100644
index 0000000..2cdcc92
--- /dev/null
+++ b/arch/arm/kernel/sched_clock.c
@@ -0,0 +1,69 @@
+/*
+ * sched_clock.c: support for extending counters to full 64-bit ns counter
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+#include <linux/clocksource.h>
+#include <linux/init.h>
+#include <linux/jiffies.h>
+#include <linux/kernel.h>
+#include <linux/sched.h>
+#include <linux/timer.h>
+
+#include <asm/sched_clock.h>
+
+static void sched_clock_poll(unsigned long wrap_ticks);
+static DEFINE_TIMER(sched_clock_timer, sched_clock_poll, 0, 0);
+static void (*sched_clock_update_fn)(void);
+
+static void sched_clock_poll(unsigned long wrap_ticks)
+{
+ mod_timer(&sched_clock_timer, round_jiffies(jiffies + wrap_ticks));
+ sched_clock_update_fn();
+}
+
+void __init init_sched_clock(struct clock_data *cd, void (*update)(void),
+ unsigned int clock_bits, unsigned long rate)
+{
+ unsigned long r, w;
+ u64 res, wrap;
+ char r_unit;
+
+ sched_clock_update_fn = update;
+
+ /* calculate the mult/shift to convert counter ticks to ns. */
+ clocks_calc_mult_shift(&cd->mult, &cd->shift, rate, NSEC_PER_SEC, 60);
+
+ r = rate;
+ if (r >= 4000000) {
+ r /= 1000000;
+ r_unit = 'M';
+ } else {
+ r /= 1000;
+ r_unit = 'k';
+ }
+
+ /* calculate how many ns until we wrap */
+ wrap = cyc_to_ns((1ULL << clock_bits) - 1, cd->mult, cd->shift);
+ do_div(wrap, NSEC_PER_MSEC);
+ w = wrap;
+
+ /* calculate the ns resolution of this counter */
+ res = cyc_to_ns(1ULL, cd->mult, cd->shift);
+ pr_info("sched_clock: %u bits at %lu%cHz, resolution %lluns, wraps every %lums\n",
+ clock_bits, r, r_unit, res, w);
+
+ /*
+ * Start the timer to keep sched_clock() properly updated and
+ * sets the initial epoch.
+ */
+ sched_clock_timer.data = msecs_to_jiffies(w - (w / 10));
+ sched_clock_poll(sched_clock_timer.data);
+
+ /*
+ * Ensure that sched_clock() starts off at 0ns
+ */
+ cd->epoch_ns = 0;
+}
--
1.6.2.5
^ permalink raw reply related [flat|nested] 77+ messages in thread* [PATCH 28/40] ARM: sched_clock: provide common infrastructure for sched_clock()
2010-12-17 11:47 ` [PATCH 28/40] ARM: sched_clock: provide common infrastructure for sched_clock() Russell King - ARM Linux
@ 2010-12-17 18:51 ` Nicolas Pitre
2010-12-17 19:05 ` Russell King - ARM Linux
0 siblings, 1 reply; 77+ messages in thread
From: Nicolas Pitre @ 2010-12-17 18:51 UTC (permalink / raw)
To: linux-arm-kernel
On Fri, 17 Dec 2010, Russell King - ARM Linux wrote:
> Provide common sched_clock() infrastructure for platforms to use to
> create a 64-bit ns based sched_clock() implementation from a counter
> running at a non-variable clock rate.
>
> This implementation is based upon maintaining an epoch for the counter
> and an epoch for the nanosecond time. When we desire a sched_clock()
> time, we calculate the number of counter ticks since the last epoch
> update, convert this to nanoseconds and add to the epoch nanoseconds.
>
> We regularly refresh these epochs within the counter wrap interval.
> We perform a similar calculation as above, and store the new epochs.
>
> We read and write the epochs in such a way that sched_clock() can easily
> (and locklessly) detect when an update is in progress, and repeat the
> loading of these constants when they're known not to be stable. The
> one caveat is that sched_clock() is not called in the middle of an
> update.
How is this ensured? I think this is currently a problem.
Right now there is nothing that prevents update_sched_clock() from
being interrupted in the middle of cd->epoch_cyc and cd->epoch_cyc_copy.
Let's say an interrupt happens when those two are different.
Within an interrupt handler, you may find calls to printk(), which may
also end up calling sched_clock() for time stamping. The sched_clock()
function will call cyc_to_fixed_sched_clock() which will deadlock.
Maybe you should at least mask interrupts in update_sched_clock() so
that the epoch update is not interruptible.
Nicolas
^ permalink raw reply [flat|nested] 77+ messages in thread
* [PATCH 28/40] ARM: sched_clock: provide common infrastructure for sched_clock()
2010-12-17 18:51 ` Nicolas Pitre
@ 2010-12-17 19:05 ` Russell King - ARM Linux
2010-12-17 19:18 ` Russell King - ARM Linux
0 siblings, 1 reply; 77+ messages in thread
From: Russell King - ARM Linux @ 2010-12-17 19:05 UTC (permalink / raw)
To: linux-arm-kernel
On Fri, Dec 17, 2010 at 01:51:35PM -0500, Nicolas Pitre wrote:
> On Fri, 17 Dec 2010, Russell King - ARM Linux wrote:
>
> > Provide common sched_clock() infrastructure for platforms to use to
> > create a 64-bit ns based sched_clock() implementation from a counter
> > running at a non-variable clock rate.
> >
> > This implementation is based upon maintaining an epoch for the counter
> > and an epoch for the nanosecond time. When we desire a sched_clock()
> > time, we calculate the number of counter ticks since the last epoch
> > update, convert this to nanoseconds and add to the epoch nanoseconds.
> >
> > We regularly refresh these epochs within the counter wrap interval.
> > We perform a similar calculation as above, and store the new epochs.
> >
> > We read and write the epochs in such a way that sched_clock() can easily
> > (and locklessly) detect when an update is in progress, and repeat the
> > loading of these constants when they're known not to be stable. The
> > one caveat is that sched_clock() is not called in the middle of an
> > update.
>
> How is this ensured? I think this is currently a problem.
>
> Right now there is nothing that prevents update_sched_clock() from
> being interrupted in the middle of cd->epoch_cyc and cd->epoch_cyc_copy.
> Let's say an interrupt happens when those two are different.
>
> Within an interrupt handler, you may find calls to printk(), which may
> also end up calling sched_clock() for time stamping. The sched_clock()
> function will call cyc_to_fixed_sched_clock() which will deadlock.
>
> Maybe you should at least mask interrupts in update_sched_clock() so
> that the epoch update is not interruptible.
I left this for you to find, as I knew you wouldn't be satisfied without
finding some hole in my scheme. ;)
Yes, you're right, it should disable local IRQs across the update. Thanks
for spotting.
^ permalink raw reply [flat|nested] 77+ messages in thread
* [PATCH 28/40] ARM: sched_clock: provide common infrastructure for sched_clock()
2010-12-17 19:05 ` Russell King - ARM Linux
@ 2010-12-17 19:18 ` Russell King - ARM Linux
2010-12-17 19:34 ` Nicolas Pitre
2010-12-17 19:37 ` Nicolas Pitre
0 siblings, 2 replies; 77+ messages in thread
From: Russell King - ARM Linux @ 2010-12-17 19:18 UTC (permalink / raw)
To: linux-arm-kernel
On Fri, Dec 17, 2010 at 07:05:54PM +0000, Russell King - ARM Linux wrote:
> Yes, you're right, it should disable local IRQs across the update. Thanks
> for spotting.
Here's the incremental patch for it. Note that we can safely explicitly
disable and re-enable IRQs as the timer subsystem ensures that we will
always be called with IRQs enabled:
spin_unlock_irq(&base->lock);
call_timer_fn(timer, fn, data);
spin_lock_irq(&base->lock);
diff --git a/arch/arm/include/asm/sched_clock.h b/arch/arm/include/asm/sched_clock.h
index 82d4d3f..5643cb0 100644
--- a/arch/arm/include/asm/sched_clock.h
+++ b/arch/arm/include/asm/sched_clock.h
@@ -30,7 +30,7 @@ static inline u64 cyc_to_ns(u64 cyc, u32 mult, u32 shift)
* Atomically update the sched_clock epoch. Your update callback will
* be called from a timer before the counter wraps - read the current
* counter value, and call this function to safely move the epochs
- * forward.
+ * forward. Only use this from the update callback.
*/
static inline void update_sched_clock(struct clock_data *cd, u32 cyc, u32 mask)
{
@@ -41,11 +41,13 @@ static inline void update_sched_clock(struct clock_data *cd, u32 cyc, u32 mask)
* Write epoch_cyc and epoch_ns in a way that the update is
* detectable in cyc_to_fixed_sched_clock().
*/
+ local_irq_disable();
cd->epoch_cyc = cyc;
smp_wmb();
cd->epoch_ns = ns;
smp_wmb();
cd->epoch_cyc_copy = cyc;
+ local_irq_enable();
}
/*
^ permalink raw reply related [flat|nested] 77+ messages in thread* [PATCH 28/40] ARM: sched_clock: provide common infrastructure for sched_clock()
2010-12-17 19:18 ` Russell King - ARM Linux
@ 2010-12-17 19:34 ` Nicolas Pitre
2010-12-17 19:37 ` Nicolas Pitre
1 sibling, 0 replies; 77+ messages in thread
From: Nicolas Pitre @ 2010-12-17 19:34 UTC (permalink / raw)
To: linux-arm-kernel
On Fri, 17 Dec 2010, Russell King - ARM Linux wrote:
> On Fri, Dec 17, 2010 at 07:05:54PM +0000, Russell King - ARM Linux wrote:
> > Yes, you're right, it should disable local IRQs across the update. Thanks
> > for spotting.
>
> Here's the incremental patch for it. Note that we can safely explicitly
> disable and re-enable IRQs as the timer subsystem ensures that we will
> always be called with IRQs enabled:
>
> spin_unlock_irq(&base->lock);
> call_timer_fn(timer, fn, data);
> spin_lock_irq(&base->lock);
Right. Might be worth putting the above in the commit log too.
With that change you may add:
Reviewed-by: Nicolas Pitre <nicolas.pitre@linaro.org>
> diff --git a/arch/arm/include/asm/sched_clock.h b/arch/arm/include/asm/sched_clock.h
> index 82d4d3f..5643cb0 100644
> --- a/arch/arm/include/asm/sched_clock.h
> +++ b/arch/arm/include/asm/sched_clock.h
> @@ -30,7 +30,7 @@ static inline u64 cyc_to_ns(u64 cyc, u32 mult, u32 shift)
> * Atomically update the sched_clock epoch. Your update callback will
> * be called from a timer before the counter wraps - read the current
> * counter value, and call this function to safely move the epochs
> - * forward.
> + * forward. Only use this from the update callback.
> */
> static inline void update_sched_clock(struct clock_data *cd, u32 cyc, u32 mask)
> {
> @@ -41,11 +41,13 @@ static inline void update_sched_clock(struct clock_data *cd, u32 cyc, u32 mask)
> * Write epoch_cyc and epoch_ns in a way that the update is
> * detectable in cyc_to_fixed_sched_clock().
> */
> + local_irq_disable();
> cd->epoch_cyc = cyc;
> smp_wmb();
> cd->epoch_ns = ns;
> smp_wmb();
> cd->epoch_cyc_copy = cyc;
> + local_irq_enable();
> }
>
> /*
>
^ permalink raw reply [flat|nested] 77+ messages in thread* [PATCH 28/40] ARM: sched_clock: provide common infrastructure for sched_clock()
2010-12-17 19:18 ` Russell King - ARM Linux
2010-12-17 19:34 ` Nicolas Pitre
@ 2010-12-17 19:37 ` Nicolas Pitre
2010-12-17 19:40 ` Russell King - ARM Linux
1 sibling, 1 reply; 77+ messages in thread
From: Nicolas Pitre @ 2010-12-17 19:37 UTC (permalink / raw)
To: linux-arm-kernel
On Fri, 17 Dec 2010, Russell King - ARM Linux wrote:
> On Fri, Dec 17, 2010 at 07:05:54PM +0000, Russell King - ARM Linux wrote:
> > Yes, you're right, it should disable local IRQs across the update. Thanks
> > for spotting.
>
> Here's the incremental patch for it. Note that we can safely explicitly
> disable and re-enable IRQs as the timer subsystem ensures that we will
> always be called with IRQs enabled:
>
> spin_unlock_irq(&base->lock);
> call_timer_fn(timer, fn, data);
> spin_lock_irq(&base->lock);
>
> diff --git a/arch/arm/include/asm/sched_clock.h b/arch/arm/include/asm/sched_clock.h
> index 82d4d3f..5643cb0 100644
> --- a/arch/arm/include/asm/sched_clock.h
> +++ b/arch/arm/include/asm/sched_clock.h
> @@ -30,7 +30,7 @@ static inline u64 cyc_to_ns(u64 cyc, u32 mult, u32 shift)
> * Atomically update the sched_clock epoch. Your update callback will
> * be called from a timer before the counter wraps - read the current
> * counter value, and call this function to safely move the epochs
> - * forward.
> + * forward. Only use this from the update callback.
> */
> static inline void update_sched_clock(struct clock_data *cd, u32 cyc, u32 mask)
> {
> @@ -41,11 +41,13 @@ static inline void update_sched_clock(struct clock_data *cd, u32 cyc, u32 mask)
> * Write epoch_cyc and epoch_ns in a way that the update is
> * detectable in cyc_to_fixed_sched_clock().
> */
> + local_irq_disable();
Actually, wouldn't it be better to use raw_local_irq_disable() here so
this is safe with a RT kernel as well?
Nicolas
^ permalink raw reply [flat|nested] 77+ messages in thread* [PATCH 28/40] ARM: sched_clock: provide common infrastructure for sched_clock()
2010-12-17 19:37 ` Nicolas Pitre
@ 2010-12-17 19:40 ` Russell King - ARM Linux
2010-12-17 19:59 ` Nicolas Pitre
0 siblings, 1 reply; 77+ messages in thread
From: Russell King - ARM Linux @ 2010-12-17 19:40 UTC (permalink / raw)
To: linux-arm-kernel
On Fri, Dec 17, 2010 at 02:37:41PM -0500, Nicolas Pitre wrote:
> On Fri, 17 Dec 2010, Russell King - ARM Linux wrote:
>
> > On Fri, Dec 17, 2010 at 07:05:54PM +0000, Russell King - ARM Linux wrote:
> > > Yes, you're right, it should disable local IRQs across the update. Thanks
> > > for spotting.
> >
> > Here's the incremental patch for it. Note that we can safely explicitly
> > disable and re-enable IRQs as the timer subsystem ensures that we will
> > always be called with IRQs enabled:
> >
> > spin_unlock_irq(&base->lock);
> > call_timer_fn(timer, fn, data);
> > spin_lock_irq(&base->lock);
> >
> > diff --git a/arch/arm/include/asm/sched_clock.h b/arch/arm/include/asm/sched_clock.h
> > index 82d4d3f..5643cb0 100644
> > --- a/arch/arm/include/asm/sched_clock.h
> > +++ b/arch/arm/include/asm/sched_clock.h
> > @@ -30,7 +30,7 @@ static inline u64 cyc_to_ns(u64 cyc, u32 mult, u32 shift)
> > * Atomically update the sched_clock epoch. Your update callback will
> > * be called from a timer before the counter wraps - read the current
> > * counter value, and call this function to safely move the epochs
> > - * forward.
> > + * forward. Only use this from the update callback.
> > */
> > static inline void update_sched_clock(struct clock_data *cd, u32 cyc, u32 mask)
> > {
> > @@ -41,11 +41,13 @@ static inline void update_sched_clock(struct clock_data *cd, u32 cyc, u32 mask)
> > * Write epoch_cyc and epoch_ns in a way that the update is
> > * detectable in cyc_to_fixed_sched_clock().
> > */
> > + local_irq_disable();
>
> Actually, wouldn't it be better to use raw_local_irq_disable() here so
> this is safe with a RT kernel as well?
Grr, there's too many different combinations of stuff... yes, it should be.
^ permalink raw reply [flat|nested] 77+ messages in thread* [PATCH 28/40] ARM: sched_clock: provide common infrastructure for sched_clock()
2010-12-17 19:40 ` Russell King - ARM Linux
@ 2010-12-17 19:59 ` Nicolas Pitre
0 siblings, 0 replies; 77+ messages in thread
From: Nicolas Pitre @ 2010-12-17 19:59 UTC (permalink / raw)
To: linux-arm-kernel
On Fri, 17 Dec 2010, Russell King - ARM Linux wrote:
> On Fri, Dec 17, 2010 at 02:37:41PM -0500, Nicolas Pitre wrote:
> > On Fri, 17 Dec 2010, Russell King - ARM Linux wrote:
> >
> > > + local_irq_disable();
> >
> > Actually, wouldn't it be better to use raw_local_irq_disable() here so
> > this is safe with a RT kernel as well?
>
> Grr, there's too many different combinations of stuff... yes, it should be.
That's why we have peer review. :-)
Nicolas
^ permalink raw reply [flat|nested] 77+ messages in thread
* [PATCH 29/40] ARM: ixp4xx: convert sched_clock() to use new infrastructure
2010-12-17 11:32 [PATCH 0/40] Complete set of clocksource/sched_clock patches Russell King - ARM Linux
` (27 preceding siblings ...)
2010-12-17 11:47 ` [PATCH 28/40] ARM: sched_clock: provide common infrastructure for sched_clock() Russell King - ARM Linux
@ 2010-12-17 11:48 ` Russell King - ARM Linux
2010-12-17 11:48 ` [PATCH 30/40] ARM: mmp: " Russell King - ARM Linux
` (19 subsequent siblings)
48 siblings, 0 replies; 77+ messages in thread
From: Russell King - ARM Linux @ 2010-12-17 11:48 UTC (permalink / raw)
To: linux-arm-kernel
Convert ixp4xx to use the new sched_clock() infrastructure for
extending 32bit counters to full 64-bit nanoseconds.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
---
arch/arm/Kconfig | 1 +
arch/arm/mach-ixp4xx/common.c | 31 ++++++++++++++++++++-----------
2 files changed, 21 insertions(+), 11 deletions(-)
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index ed7a0a7..6f58bce 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -437,6 +437,7 @@ config ARCH_IXP4XX
select CPU_XSCALE
select GENERIC_GPIO
select GENERIC_CLOCKEVENTS
+ select HAVE_SCHED_CLOCK
select DMABOUNCE if PCI
help
Support for Intel's IXP4XX (XScale) family of processors.
diff --git a/arch/arm/mach-ixp4xx/common.c b/arch/arm/mach-ixp4xx/common.c
index e0b91d8..4dbfcbb 100644
--- a/arch/arm/mach-ixp4xx/common.c
+++ b/arch/arm/mach-ixp4xx/common.c
@@ -35,6 +35,7 @@
#include <asm/pgtable.h>
#include <asm/page.h>
#include <asm/irq.h>
+#include <asm/sched_clock.h>
#include <asm/mach/map.h>
#include <asm/mach/irq.h>
@@ -399,6 +400,23 @@ void __init ixp4xx_sys_init(void)
}
/*
+ * sched_clock()
+ */
+static DEFINE_CLOCK_DATA(cd);
+
+unsigned long long notrace sched_clock(void)
+{
+ u32 cyc = *IXP4XX_OSTS;
+ return cyc_to_sched_clock(&cd, cyc, (u32)~0);
+}
+
+static void notrace ixp4xx_update_sched_clock(void)
+{
+ u32 cyc = *IXP4XX_OSTS;
+ update_sched_clock(&cd, cyc, (u32)~0);
+}
+
+/*
* clocksource
*/
static cycle_t ixp4xx_get_cycles(struct clocksource *cs)
@@ -418,18 +436,9 @@ unsigned long ixp4xx_timer_freq = FREQ;
EXPORT_SYMBOL(ixp4xx_timer_freq);
static void __init ixp4xx_clocksource_init(void)
{
- clocksource_register_hz(&clocksource_ixp4xx, ixp4xx_timer_freq);
-}
-
-/*
- * sched_clock()
- */
-unsigned long long notrace sched_clock(void)
-{
- cycle_t cyc = ixp4xx_get_cycles(NULL);
- struct clocksource *cs = &clocksource_ixp4xx;
+ init_sched_clock(&cd, ixp4xx_update_sched_clock, 32, ixp4xx_timer_freq);
- return clocksource_cyc2ns(cyc, cs->mult, cs->shift);
+ clocksource_register_hz(&clocksource_ixp4xx, ixp4xx_timer_freq);
}
/*
--
1.6.2.5
^ permalink raw reply related [flat|nested] 77+ messages in thread* [PATCH 30/40] ARM: mmp: convert sched_clock() to use new infrastructure
2010-12-17 11:32 [PATCH 0/40] Complete set of clocksource/sched_clock patches Russell King - ARM Linux
` (28 preceding siblings ...)
2010-12-17 11:48 ` [PATCH 29/40] ARM: ixp4xx: convert sched_clock() to use new infrastructure Russell King - ARM Linux
@ 2010-12-17 11:48 ` Russell King - ARM Linux
2010-12-17 11:48 ` [PATCH 31/40] ARM: pxa: " Russell King - ARM Linux
` (18 subsequent siblings)
48 siblings, 0 replies; 77+ messages in thread
From: Russell King - ARM Linux @ 2010-12-17 11:48 UTC (permalink / raw)
To: linux-arm-kernel
Convert mmp to use the new sched_clock() infrastructure for extending
32bit counters to full 64-bit nanoseconds.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
---
arch/arm/Kconfig | 1 +
arch/arm/mach-mmp/time.c | 32 +++++++++++---------------------
2 files changed, 12 insertions(+), 21 deletions(-)
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 6f58bce..0208e1e 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -513,6 +513,7 @@ config ARCH_MMP
select ARCH_REQUIRE_GPIOLIB
select COMMON_CLKDEV
select GENERIC_CLOCKEVENTS
+ select HAVE_SCHED_CLOCK
select TICK_ONESHOT
select PLAT_PXA
select SPARSE_IRQ
diff --git a/arch/arm/mach-mmp/time.c b/arch/arm/mach-mmp/time.c
index a2ea33d..aeb9ae2 100644
--- a/arch/arm/mach-mmp/time.c
+++ b/arch/arm/mach-mmp/time.c
@@ -26,8 +26,8 @@
#include <linux/io.h>
#include <linux/irq.h>
#include <linux/sched.h>
-#include <linux/cnt32_to_63.h>
+#include <asm/sched_clock.h>
#include <mach/addr-map.h>
#include <mach/regs-timers.h>
#include <mach/regs-apbc.h>
@@ -42,23 +42,7 @@
#define MAX_DELTA (0xfffffffe)
#define MIN_DELTA (16)
-#define TCR2NS_SCALE_FACTOR 10
-
-static unsigned long tcr2ns_scale;
-
-static void __init set_tcr2ns_scale(unsigned long tcr_rate)
-{
- unsigned long long v = 1000000000ULL << TCR2NS_SCALE_FACTOR;
- do_div(v, tcr_rate);
- tcr2ns_scale = v;
- /*
- * We want an even value to automatically clear the top bit
- * returned by cnt32_to_63() without an additional run time
- * instruction. So if the LSB is 1 then round it up.
- */
- if (tcr2ns_scale & 1)
- tcr2ns_scale++;
-}
+static DEFINE_CLOCK_DATA(cd);
/*
* FIXME: the timer needs some delay to stablize the counter capture
@@ -77,8 +61,14 @@ static inline uint32_t timer_read(void)
unsigned long long notrace sched_clock(void)
{
- unsigned long long v = cnt32_to_63(timer_read());
- return (v * tcr2ns_scale) >> TCR2NS_SCALE_FACTOR;
+ u32 cyc = timer_read();
+ return cyc_to_sched_clock(&cd, cyc, (u32)~0);
+}
+
+static void notrace mmp_update_sched_clock(void)
+{
+ u32 cyc = timer_read();
+ update_sched_clock(&cd, cyc, (u32)~0);
}
static irqreturn_t timer_interrupt(int irq, void *dev_id)
@@ -185,7 +175,7 @@ void __init timer_init(int irq)
{
timer_config();
- set_tcr2ns_scale(CLOCK_TICK_RATE);
+ init_sched_clock(&cd, mmp_update_sched_clock, 32, CLOCK_TICK_RATE);
ckevt.mult = div_sc(CLOCK_TICK_RATE, NSEC_PER_SEC, ckevt.shift);
ckevt.max_delta_ns = clockevent_delta2ns(MAX_DELTA, &ckevt);
--
1.6.2.5
^ permalink raw reply related [flat|nested] 77+ messages in thread* [PATCH 31/40] ARM: pxa: convert sched_clock() to use new infrastructure
2010-12-17 11:32 [PATCH 0/40] Complete set of clocksource/sched_clock patches Russell King - ARM Linux
` (29 preceding siblings ...)
2010-12-17 11:48 ` [PATCH 30/40] ARM: mmp: " Russell King - ARM Linux
@ 2010-12-17 11:48 ` Russell King - ARM Linux
2010-12-17 11:49 ` [PATCH 32/40] ARM: sa1100: " Russell King - ARM Linux
` (17 subsequent siblings)
48 siblings, 0 replies; 77+ messages in thread
From: Russell King - ARM Linux @ 2010-12-17 11:48 UTC (permalink / raw)
To: linux-arm-kernel
Convert pxa to use the new sched_clock() infrastructure for extending
32bit counters to full 64-bit nanoseconds.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
---
arch/arm/Kconfig | 1 +
arch/arm/mach-pxa/time.c | 29 +++++++++--------------------
2 files changed, 10 insertions(+), 20 deletions(-)
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 0208e1e..23035d6 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -593,6 +593,7 @@ config ARCH_PXA
select COMMON_CLKDEV
select ARCH_REQUIRE_GPIOLIB
select GENERIC_CLOCKEVENTS
+ select HAVE_SCHED_CLOCK
select TICK_ONESHOT
select PLAT_PXA
select SPARSE_IRQ
diff --git a/arch/arm/mach-pxa/time.c b/arch/arm/mach-pxa/time.c
index b8d9dff..e7f64d9 100644
--- a/arch/arm/mach-pxa/time.c
+++ b/arch/arm/mach-pxa/time.c
@@ -17,11 +17,11 @@
#include <linux/interrupt.h>
#include <linux/clockchips.h>
#include <linux/sched.h>
-#include <linux/cnt32_to_63.h>
#include <asm/div64.h>
#include <asm/mach/irq.h>
#include <asm/mach/time.h>
+#include <asm/sched_clock.h>
#include <mach/regs-ost.h>
/*
@@ -32,29 +32,18 @@
* long as there is always less than 582 seconds between successive
* calls to sched_clock() which should always be the case in practice.
*/
+static DEFINE_CLOCK_DATA(cd);
-#define OSCR2NS_SCALE_FACTOR 10
-
-static unsigned long oscr2ns_scale;
-
-static void __init set_oscr2ns_scale(unsigned long oscr_rate)
+unsigned long long notrace sched_clock(void)
{
- unsigned long long v = 1000000000ULL << OSCR2NS_SCALE_FACTOR;
- do_div(v, oscr_rate);
- oscr2ns_scale = v;
- /*
- * We want an even value to automatically clear the top bit
- * returned by cnt32_to_63() without an additional run time
- * instruction. So if the LSB is 1 then round it up.
- */
- if (oscr2ns_scale & 1)
- oscr2ns_scale++;
+ u32 cyc = OSCR;
+ return cyc_to_sched_clock(&cd, cyc, (u32)~0);
}
-unsigned long long notrace sched_clock(void)
+static void notrace pxa_update_sched_clock(void)
{
- unsigned long long v = cnt32_to_63(OSCR);
- return (v * oscr2ns_scale) >> OSCR2NS_SCALE_FACTOR;
+ u32 cyc = OSCR;
+ update_sched_clock(&cd, cyc, (u32)~0);
}
@@ -144,7 +133,7 @@ static void __init pxa_timer_init(void)
OIER = 0;
OSSR = OSSR_M0 | OSSR_M1 | OSSR_M2 | OSSR_M3;
- set_oscr2ns_scale(clock_tick_rate);
+ init_sched_clock(&cd, pxa_update_sched_clock, 32, clock_tick_rate);
ckevt_pxa_osmr0.mult =
div_sc(clock_tick_rate, NSEC_PER_SEC, ckevt_pxa_osmr0.shift);
--
1.6.2.5
^ permalink raw reply related [flat|nested] 77+ messages in thread* [PATCH 32/40] ARM: sa1100: convert sched_clock() to use new infrastructure
2010-12-17 11:32 [PATCH 0/40] Complete set of clocksource/sched_clock patches Russell King - ARM Linux
` (30 preceding siblings ...)
2010-12-17 11:48 ` [PATCH 31/40] ARM: pxa: " Russell King - ARM Linux
@ 2010-12-17 11:49 ` Russell King - ARM Linux
2010-12-17 11:49 ` [PATCH 33/40] ARM: tegra: " Russell King - ARM Linux
` (16 subsequent siblings)
48 siblings, 0 replies; 77+ messages in thread
From: Russell King - ARM Linux @ 2010-12-17 11:49 UTC (permalink / raw)
To: linux-arm-kernel
Convert sa1100 to use the new sched_clock() infrastructure for extending
32bit counters to full 64-bit nanoseconds.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
---
arch/arm/Kconfig | 1 +
arch/arm/mach-sa1100/generic.c | 23 -----------------------
arch/arm/mach-sa1100/time.c | 30 ++++++++++++++++++++++++++++++
3 files changed, 31 insertions(+), 23 deletions(-)
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 23035d6..0e1a966 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -642,6 +642,7 @@ config ARCH_SA1100
select CPU_FREQ
select GENERIC_CLOCKEVENTS
select HAVE_CLK
+ select HAVE_SCHED_CLOCK
select TICK_ONESHOT
select ARCH_REQUIRE_GPIOLIB
help
diff --git a/arch/arm/mach-sa1100/generic.c b/arch/arm/mach-sa1100/generic.c
index 33b4969..fbc224d 100644
--- a/arch/arm/mach-sa1100/generic.c
+++ b/arch/arm/mach-sa1100/generic.c
@@ -16,9 +16,7 @@
#include <linux/pm.h>
#include <linux/cpufreq.h>
#include <linux/ioport.h>
-#include <linux/sched.h> /* just for sched_clock() - funny that */
#include <linux/platform_device.h>
-#include <linux/cnt32_to_63.h>
#include <asm/div64.h>
#include <mach/hardware.h>
@@ -110,27 +108,6 @@ unsigned int sa11x0_getspeed(unsigned int cpu)
}
/*
- * This is the SA11x0 sched_clock implementation. This has
- * a resolution of 271ns, and a maximum value of 32025597s (370 days).
- *
- * The return value is guaranteed to be monotonic in that range as
- * long as there is always less than 582 seconds between successive
- * calls to this function.
- *
- * ( * 1E9 / 3686400 => * 78125 / 288)
- */
-unsigned long long notrace sched_clock(void)
-{
- unsigned long long v = cnt32_to_63(OSCR);
-
- /* the <<1 gets rid of the cnt_32_to_63 top bit saving on a bic insn */
- v *= 78125<<1;
- do_div(v, 288<<1);
-
- return v;
-}
-
-/*
* Default power-off for SA1100
*/
static void sa1100_power_off(void)
diff --git a/arch/arm/mach-sa1100/time.c b/arch/arm/mach-sa1100/time.c
index 96154f5..ae4f3d8 100644
--- a/arch/arm/mach-sa1100/time.c
+++ b/arch/arm/mach-sa1100/time.c
@@ -12,12 +12,39 @@
#include <linux/errno.h>
#include <linux/interrupt.h>
#include <linux/irq.h>
+#include <linux/sched.h> /* just for sched_clock() - funny that */
#include <linux/timex.h>
#include <linux/clockchips.h>
#include <asm/mach/time.h>
+#include <asm/sched_clock.h>
#include <mach/hardware.h>
+/*
+ * This is the SA11x0 sched_clock implementation.
+ */
+static DEFINE_CLOCK_DATA(cd);
+
+/*
+ * Constants generated by clocks_calc_mult_shift(m, s, 3.6864MHz,
+ * NSEC_PER_SEC, 60).
+ * This gives a resolution of about 271ns and a wrap period of about 19min.
+ */
+#define SC_MULT 2275555556u
+#define SC_SHIFT 23
+
+unsigned long long notrace sched_clock(void)
+{
+ u32 cyc = OSCR;
+ return cyc_to_fixed_sched_clock(&cd, cyc, (u32)~0, SC_MULT, SC_SHIFT);
+}
+
+static void notrace sa1100_update_sched_clock(void)
+{
+ u32 cyc = OSCR;
+ update_sched_clock(&cd, cyc, (u32)~0);
+}
+
#define MIN_OSCR_DELTA 2
static irqreturn_t sa1100_ost0_interrupt(int irq, void *dev_id)
@@ -96,6 +123,9 @@ static void __init sa1100_timer_init(void)
OIER = 0; /* disable any timer interrupts */
OSSR = 0xf; /* clear status on all timers */
+ init_fixed_sched_clock(&cd, sa1100_update_sched_clock, 32,
+ 3686400, SC_MULT, SC_SHIFT);
+
ckevt_sa1100_osmr0.mult =
div_sc(3686400, NSEC_PER_SEC, ckevt_sa1100_osmr0.shift);
ckevt_sa1100_osmr0.max_delta_ns =
--
1.6.2.5
^ permalink raw reply related [flat|nested] 77+ messages in thread* [PATCH 33/40] ARM: tegra: convert sched_clock() to use new infrastructure
2010-12-17 11:32 [PATCH 0/40] Complete set of clocksource/sched_clock patches Russell King - ARM Linux
` (31 preceding siblings ...)
2010-12-17 11:49 ` [PATCH 32/40] ARM: sa1100: " Russell King - ARM Linux
@ 2010-12-17 11:49 ` Russell King - ARM Linux
2010-12-22 7:23 ` Olof Johansson
2010-12-17 11:49 ` [PATCH 34/40] ARM: u300: " Russell King - ARM Linux
` (15 subsequent siblings)
48 siblings, 1 reply; 77+ messages in thread
From: Russell King - ARM Linux @ 2010-12-17 11:49 UTC (permalink / raw)
To: linux-arm-kernel
Convert tegra to use the new sched_clock() infrastructure for extending
32bit counters to full 64-bit nanoseconds.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
---
arch/arm/Kconfig | 1 +
arch/arm/mach-tegra/timer.c | 22 ++++++++++++++++++++--
2 files changed, 21 insertions(+), 2 deletions(-)
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 0e1a966..ec7b027 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -570,6 +570,7 @@ config ARCH_TEGRA
select GENERIC_CLOCKEVENTS
select GENERIC_GPIO
select HAVE_CLK
+ select HAVE_SCHED_CLOCK
select COMMON_CLKDEV
select ARCH_HAS_BARRIERS if CACHE_L2X0
select ARCH_HAS_CPUFREQ
diff --git a/arch/arm/mach-tegra/timer.c b/arch/arm/mach-tegra/timer.c
index c52bd84..b5f86dd 100644
--- a/arch/arm/mach-tegra/timer.c
+++ b/arch/arm/mach-tegra/timer.c
@@ -26,7 +26,6 @@
#include <linux/clocksource.h>
#include <linux/clk.h>
#include <linux/io.h>
-#include <linux/cnt32_to_63.h>
#include <asm/mach/time.h>
#include <asm/localtimer.h>
@@ -111,9 +110,25 @@ static struct clocksource tegra_clocksource = {
.flags = CLOCK_SOURCE_IS_CONTINUOUS,
};
+static DEFINE_CLOCK_DATA(cd);
+
+/*
+ * Constants generated by clocks_calc_mult_shift(m, s, 1MHz, NSEC_PER_SEC, 60).
+ * This gives a resolution of about 1us and a wrap period of about 1h11min.
+ */
+#define SC_MULT 4194304000u
+#define SC_SHIFT 22
+
unsigned long long notrace sched_clock(void)
{
- return cnt32_to_63(timer_readl(TIMERUS_CNTR_1US)) * 1000;
+ u32 cyc = timer_readl(TIMERUS_CNTR_1US);
+ return cyc_to_fixed_sched_clock(&cd, cyc, (u32)~0, SC_MULT, SC_SHIFT);
+}
+
+static void notrace tegra_update_sched_clock(void)
+{
+ u32 cyc = timer_readl(TIMERUS_CNTR_1US);
+ update_sched_clock(&cd, cyc, (u32)~0);
}
static irqreturn_t tegra_timer_interrupt(int irq, void *dev_id)
@@ -158,6 +173,9 @@ static void __init tegra_init_timer(void)
WARN(1, "Unknown clock rate");
}
+ init_fixed_sched_clock(&cd, tegra_update_sched_clock, 32,
+ 1000000, SC_MULT, SC_SHIFT);
+
if (clocksource_register_hz(&tegra_clocksource, 1000000)) {
printk(KERN_ERR "Failed to register clocksource\n");
BUG();
--
1.6.2.5
^ permalink raw reply related [flat|nested] 77+ messages in thread* [PATCH 33/40] ARM: tegra: convert sched_clock() to use new infrastructure
2010-12-17 11:49 ` [PATCH 33/40] ARM: tegra: " Russell King - ARM Linux
@ 2010-12-22 7:23 ` Olof Johansson
2010-12-22 23:06 ` Russell King - ARM Linux
0 siblings, 1 reply; 77+ messages in thread
From: Olof Johansson @ 2010-12-22 7:23 UTC (permalink / raw)
To: linux-arm-kernel
Hi,
On Fri, Dec 17, 2010 at 3:49 AM, Russell King - ARM Linux
<linux@arm.linux.org.uk> wrote:
> Convert tegra to use the new sched_clock() infrastructure for extending
> 32bit counters to full 64-bit nanoseconds.
>
> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
> ---
> ?arch/arm/Kconfig ? ? ? ? ? ?| ? ?1 +
> ?arch/arm/mach-tegra/timer.c | ? 22 ++++++++++++++++++++--
> ?2 files changed, 21 insertions(+), 2 deletions(-)
>
> diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
> index 0e1a966..ec7b027 100644
> --- a/arch/arm/Kconfig
> +++ b/arch/arm/Kconfig
> @@ -570,6 +570,7 @@ config ARCH_TEGRA
> ? ? ? ?select GENERIC_CLOCKEVENTS
> ? ? ? ?select GENERIC_GPIO
> ? ? ? ?select HAVE_CLK
> + ? ? ? select HAVE_SCHED_CLOCK
> ? ? ? ?select COMMON_CLKDEV
> ? ? ? ?select ARCH_HAS_BARRIERS if CACHE_L2X0
> ? ? ? ?select ARCH_HAS_CPUFREQ
> diff --git a/arch/arm/mach-tegra/timer.c b/arch/arm/mach-tegra/timer.c
> index c52bd84..b5f86dd 100644
> --- a/arch/arm/mach-tegra/timer.c
> +++ b/arch/arm/mach-tegra/timer.c
> @@ -26,7 +26,6 @@
> ?#include <linux/clocksource.h>
> ?#include <linux/clk.h>
> ?#include <linux/io.h>
> -#include <linux/cnt32_to_63.h>
>
> ?#include <asm/mach/time.h>
> ?#include <asm/localtimer.h>
This needs:
#include <asm/sched_clock.h>
(for DEFINE_CLOCK_DATA and other declarations)
-Olof
^ permalink raw reply [flat|nested] 77+ messages in thread
* [PATCH 34/40] ARM: u300: convert sched_clock() to use new infrastructure
2010-12-17 11:32 [PATCH 0/40] Complete set of clocksource/sched_clock patches Russell King - ARM Linux
` (32 preceding siblings ...)
2010-12-17 11:49 ` [PATCH 33/40] ARM: tegra: " Russell King - ARM Linux
@ 2010-12-17 11:49 ` Russell King - ARM Linux
2010-12-19 22:26 ` Linus Walleij
2010-12-17 11:50 ` [PATCH 35/40] ARM: iop: " Russell King - ARM Linux
` (14 subsequent siblings)
48 siblings, 1 reply; 77+ messages in thread
From: Russell King - ARM Linux @ 2010-12-17 11:49 UTC (permalink / raw)
To: linux-arm-kernel
Convert u300 to use the new sched_clock() infrastructure for extending
32bit counters to full 64-bit nanoseconds.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
---
arch/arm/Kconfig | 1 +
arch/arm/mach-u300/timer.c | 17 +++++++++++++----
2 files changed, 14 insertions(+), 4 deletions(-)
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index ec7b027..d5bd266 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -790,6 +790,7 @@ config ARCH_U300
bool "ST-Ericsson U300 Series"
depends on MMU
select CPU_ARM926T
+ select HAVE_SCHED_CLOCK
select HAVE_TCM
select ARM_AMBA
select ARM_VIC
diff --git a/arch/arm/mach-u300/timer.c b/arch/arm/mach-u300/timer.c
index 6c68fe7..3ec58bd 100644
--- a/arch/arm/mach-u300/timer.c
+++ b/arch/arm/mach-u300/timer.c
@@ -22,6 +22,7 @@
#include <mach/hardware.h>
/* Generic stuff */
+#include <asm/sched_clock.h>
#include <asm/mach/map.h>
#include <asm/mach/time.h>
#include <asm/mach/irq.h>
@@ -353,12 +354,18 @@ static struct clocksource clocksource_u300_1mhz = {
* this wraps around for now, since it is just a relative time
* stamp. (Inspired by OMAP implementation.)
*/
+static DEFINE_CLOCK_DATA(cd);
+
unsigned long long notrace sched_clock(void)
{
- return clocksource_cyc2ns(clocksource_u300_1mhz.read(
- &clocksource_u300_1mhz),
- clocksource_u300_1mhz.mult,
- clocksource_u300_1mhz.shift);
+ u32 cyc = readl(U300_TIMER_APP_VBASE + U300_TIMER_APP_GPT2CC);
+ return cyc_to_sched_clock(&cd, cyc, (u32)~0);
+}
+
+static void notrace u300_update_sched_clock(void)
+{
+ u32 cyc = readl(U300_TIMER_APP_VBASE + U300_TIMER_APP_GPT2CC);
+ update_sched_clock(&cd, cyc, (u32)~0);
}
@@ -376,6 +383,8 @@ static void __init u300_timer_init(void)
clk_enable(clk);
rate = clk_get_rate(clk);
+ init_sched_clock(&cd, u300_update_sched_clock, 32, rate);
+
/*
* Disable the "OS" and "DD" timers - these are designed for Symbian!
* Example usage in cnh1601578 cpu subsystem pd_timer_app.c
--
1.6.2.5
^ permalink raw reply related [flat|nested] 77+ messages in thread* [PATCH 35/40] ARM: iop: convert sched_clock() to use new infrastructure
2010-12-17 11:32 [PATCH 0/40] Complete set of clocksource/sched_clock patches Russell King - ARM Linux
` (33 preceding siblings ...)
2010-12-17 11:49 ` [PATCH 34/40] ARM: u300: " Russell King - ARM Linux
@ 2010-12-17 11:50 ` Russell King - ARM Linux
2010-12-19 10:56 ` Russell King - ARM Linux
2010-12-17 11:50 ` [PATCH 36/40] ARM: nomadik: " Russell King - ARM Linux
` (13 subsequent siblings)
48 siblings, 1 reply; 77+ messages in thread
From: Russell King - ARM Linux @ 2010-12-17 11:50 UTC (permalink / raw)
To: linux-arm-kernel
Convert iop platforms to use the new sched_clock() infrastructure for
extending 32bit counters to full 64-bit nanoseconds.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
---
arch/arm/Kconfig | 1 +
arch/arm/plat-iop/time.c | 14 +++++++++++---
2 files changed, 12 insertions(+), 3 deletions(-)
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index d5bd266..58e2fe3 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -992,6 +992,7 @@ config ARCH_ACORN
config PLAT_IOP
bool
select GENERIC_CLOCKEVENTS
+ select HAVE_SCHED_CLOCK
config PLAT_ORION
bool
diff --git a/arch/arm/plat-iop/time.c b/arch/arm/plat-iop/time.c
index 0c6da54..405fc09 100644
--- a/arch/arm/plat-iop/time.c
+++ b/arch/arm/plat-iop/time.c
@@ -50,15 +50,21 @@ static struct clocksource iop_clocksource = {
.flags = CLOCK_SOURCE_IS_CONTINUOUS,
};
+static DEFINE_CLOCK_DATA(cd);
+
/*
* IOP sched_clock() implementation via its clocksource.
*/
unsigned long long notrace sched_clock(void)
{
- cycle_t cyc = iop_clocksource_read(NULL);
- struct clocksource *cs = &iop_clocksource;
+ u32 cyc = 0xffffffffu - read_tcr1();
+ return cyc_to_sched_clock(&cd, cyc, (u32)~0);
+}
- return clocksource_cyc2ns(cyc, cs->mult, cs->shift);
+static void notrace iop_update_sched_clock(void)
+{
+ u32 cyc = 0xffffffffu - read_tcr1();
+ update_sched_clock(&cd, cyc, (u32)~0);
}
/*
@@ -143,6 +149,8 @@ void __init iop_init_time(unsigned long tick_rate)
{
u32 timer_ctl;
+ init_sched_clock(&cd, iop_update_sched_clock, 32, tick_rate);
+
ticks_per_jiffy = DIV_ROUND_CLOSEST(tick_rate, HZ);
iop_tick_rate = tick_rate;
--
1.6.2.5
^ permalink raw reply related [flat|nested] 77+ messages in thread* [PATCH 35/40] ARM: iop: convert sched_clock() to use new infrastructure
2010-12-17 11:50 ` [PATCH 35/40] ARM: iop: " Russell King - ARM Linux
@ 2010-12-19 10:56 ` Russell King - ARM Linux
0 siblings, 0 replies; 77+ messages in thread
From: Russell King - ARM Linux @ 2010-12-19 10:56 UTC (permalink / raw)
To: linux-arm-kernel
Convert iop platforms to use the new sched_clock() infrastructure for
extending 32bit counters to full 64-bit nanoseconds.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
---
Now with missing include added!
arch/arm/Kconfig | 1 +
arch/arm/plat-iop/time.c | 15 ++++++++++++---
2 files changed, 13 insertions(+), 3 deletions(-)
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index d5bd266..58e2fe3 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -992,6 +992,7 @@ config ARCH_ACORN
config PLAT_IOP
bool
select GENERIC_CLOCKEVENTS
+ select HAVE_SCHED_CLOCK
config PLAT_ORION
bool
diff --git a/arch/arm/plat-iop/time.c b/arch/arm/plat-iop/time.c
index 0c6da54..0ca000d 100644
--- a/arch/arm/plat-iop/time.c
+++ b/arch/arm/plat-iop/time.c
@@ -24,6 +24,7 @@
#include <linux/clockchips.h>
#include <mach/hardware.h>
#include <asm/irq.h>
+#include <asm/sched_clock.h>
#include <asm/uaccess.h>
#include <asm/mach/irq.h>
#include <asm/mach/time.h>
@@ -50,15 +51,21 @@ static struct clocksource iop_clocksource = {
.flags = CLOCK_SOURCE_IS_CONTINUOUS,
};
+static DEFINE_CLOCK_DATA(cd);
+
/*
* IOP sched_clock() implementation via its clocksource.
*/
unsigned long long notrace sched_clock(void)
{
- cycle_t cyc = iop_clocksource_read(NULL);
- struct clocksource *cs = &iop_clocksource;
+ u32 cyc = 0xffffffffu - read_tcr1();
+ return cyc_to_sched_clock(&cd, cyc, (u32)~0);
+}
- return clocksource_cyc2ns(cyc, cs->mult, cs->shift);
+static void notrace iop_update_sched_clock(void)
+{
+ u32 cyc = 0xffffffffu - read_tcr1();
+ update_sched_clock(&cd, cyc, (u32)~0);
}
/*
@@ -143,6 +150,8 @@ void __init iop_init_time(unsigned long tick_rate)
{
u32 timer_ctl;
+ init_sched_clock(&cd, iop_update_sched_clock, 32, tick_rate);
+
ticks_per_jiffy = DIV_ROUND_CLOSEST(tick_rate, HZ);
iop_tick_rate = tick_rate;
--
1.6.2.5
^ permalink raw reply related [flat|nested] 77+ messages in thread
* [PATCH 36/40] ARM: nomadik: convert sched_clock() to use new infrastructure
2010-12-17 11:32 [PATCH 0/40] Complete set of clocksource/sched_clock patches Russell King - ARM Linux
` (34 preceding siblings ...)
2010-12-17 11:50 ` [PATCH 35/40] ARM: iop: " Russell King - ARM Linux
@ 2010-12-17 11:50 ` Russell King - ARM Linux
2010-12-19 22:25 ` Linus Walleij
2010-12-17 11:50 ` [PATCH 37/40] ARM: omap: " Russell King - ARM Linux
` (12 subsequent siblings)
48 siblings, 1 reply; 77+ messages in thread
From: Russell King - ARM Linux @ 2010-12-17 11:50 UTC (permalink / raw)
To: linux-arm-kernel
Convert nomadik platforms to use the new sched_clock() infrastructure
for extending 32bit counters to full 64-bit nanoseconds.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
---
arch/arm/plat-nomadik/Kconfig | 1 +
arch/arm/plat-nomadik/timer.c | 76 +++++------------------------------------
2 files changed, 10 insertions(+), 67 deletions(-)
diff --git a/arch/arm/plat-nomadik/Kconfig b/arch/arm/plat-nomadik/Kconfig
index 5da3f97..187f4e8 100644
--- a/arch/arm/plat-nomadik/Kconfig
+++ b/arch/arm/plat-nomadik/Kconfig
@@ -14,6 +14,7 @@ if PLAT_NOMADIK
config HAS_MTU
bool
+ select HAVE_SCHED_CLOCK
help
Support for Multi Timer Unit. MTU provides access
to multiple interrupt generating programmable
diff --git a/arch/arm/plat-nomadik/timer.c b/arch/arm/plat-nomadik/timer.c
index c3b8a22..4172340 100644
--- a/arch/arm/plat-nomadik/timer.c
+++ b/arch/arm/plat-nomadik/timer.c
@@ -17,10 +17,9 @@
#include <linux/clk.h>
#include <linux/jiffies.h>
#include <linux/err.h>
-#include <linux/cnt32_to_63.h>
-#include <linux/timer.h>
#include <linux/sched.h>
#include <asm/mach/time.h>
+#include <asm/sched_clock.h>
#include <plat/mtu.h>
@@ -53,81 +52,24 @@ static struct clocksource nmdk_clksrc = {
* Override the global weak sched_clock symbol with this
* local implementation which uses the clocksource to get some
* better resolution when scheduling the kernel.
- *
- * Because the hardware timer period may be quite short
- * (32.3 secs on the 133 MHz MTU timer selection on ux500)
- * and because cnt32_to_63() needs to be called at least once per
- * half period to work properly, a kernel keepwarm() timer is set up
- * to ensure this requirement is always met.
- *
- * Also the sched_clock timer will wrap around at some point,
- * here we set it to run continously for a year.
*/
-#define SCHED_CLOCK_MIN_WRAP 3600*24*365
-static struct timer_list cnt32_to_63_keepwarm_timer;
-static u32 sched_mult;
-static u32 sched_shift;
+static DEFINE_CLOCK_DATA(cd);
unsigned long long notrace sched_clock(void)
{
- u64 cycles;
+ u32 cyc;
if (unlikely(!mtu_base))
return 0;
- cycles = cnt32_to_63(-readl(mtu_base + MTU_VAL(0)));
- /*
- * sched_mult is guaranteed to be even so will
- * shift out bit 63
- */
- return (cycles * sched_mult) >> sched_shift;
+ cyc = -readl(mtu_base + MTU_VAL(0));
+ return cyc_to_sched_clock(&cd, cyc, (u32)~0);
}
-/* Just kick sched_clock every so often */
-static void cnt32_to_63_keepwarm(unsigned long data)
+static void notrace nomadik_update_sched_clock(void)
{
- mod_timer(&cnt32_to_63_keepwarm_timer, round_jiffies(jiffies + data));
- (void) sched_clock();
-}
-
-/*
- * Set up a timer to keep sched_clock():s 32_to_63 algorithm warm
- * once in half a 32bit timer wrap interval.
- */
-static void __init nmdk_sched_clock_init(unsigned long rate)
-{
- u32 v;
- unsigned long delta;
- u64 days;
-
- /* Find the apropriate mult and shift factors */
- clocks_calc_mult_shift(&sched_mult, &sched_shift,
- rate, NSEC_PER_SEC, SCHED_CLOCK_MIN_WRAP);
- /* We need to multiply by an even number to get rid of bit 63 */
- if (sched_mult & 1)
- sched_mult++;
-
- /* Let's see what we get, take max counter and scale it */
- days = (0xFFFFFFFFFFFFFFFFLLU * sched_mult) >> sched_shift;
- do_div(days, NSEC_PER_SEC);
- do_div(days, (3600*24));
-
- pr_info("sched_clock: using %d bits @ %lu Hz wrap in %lu days\n",
- (64 - sched_shift), rate, (unsigned long) days);
-
- /*
- * Program a timer to kick us at half 32bit wraparound
- * Formula: seconds per wrap = (2^32) / f
- */
- v = 0xFFFFFFFFUL / rate;
- /* We want half of the wrap time to keep cnt32_to_63 warm */
- v /= 2;
- pr_debug("sched_clock: prescaled timer rate: %lu Hz, "
- "initialize keepwarm timer every %d seconds\n", rate, v);
- /* Convert seconds to jiffies */
- delta = msecs_to_jiffies(v*1000);
- setup_timer(&cnt32_to_63_keepwarm_timer, cnt32_to_63_keepwarm, delta);
- mod_timer(&cnt32_to_63_keepwarm_timer, round_jiffies(jiffies + delta));
+ u32 cyc = -readl(mtu_base + MTU_VAL(0));
+ update_sched_clock(&cd, cyc, (u32)~0);
}
/* Clockevent device: use one-shot mode */
@@ -237,7 +179,7 @@ void __init nmdk_timer_init(void)
pr_err("timer: failed to initialize clock source %s\n",
nmdk_clksrc.name);
- nmdk_sched_clock_init(rate);
+ init_sched_clock(&cd, nomadik_update_sched_clock, 32, rate);
/* Timer 1 is used for events */
--
1.6.2.5
^ permalink raw reply related [flat|nested] 77+ messages in thread* [PATCH 37/40] ARM: omap: convert sched_clock() to use new infrastructure
2010-12-17 11:32 [PATCH 0/40] Complete set of clocksource/sched_clock patches Russell King - ARM Linux
` (35 preceding siblings ...)
2010-12-17 11:50 ` [PATCH 36/40] ARM: nomadik: " Russell King - ARM Linux
@ 2010-12-17 11:50 ` Russell King - ARM Linux
2010-12-17 11:51 ` [PATCH 38/40] ARM: orion: " Russell King - ARM Linux
` (11 subsequent siblings)
48 siblings, 0 replies; 77+ messages in thread
From: Russell King - ARM Linux @ 2010-12-17 11:50 UTC (permalink / raw)
To: linux-arm-kernel
Convert omap to use the new sched_clock() infrastructure for extending
32bit counters to full 64-bit nanoseconds.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
---
arch/arm/Kconfig | 1 +
arch/arm/plat-omap/counter_32k.c | 24 ++++++++++++++++++++++--
2 files changed, 23 insertions(+), 2 deletions(-)
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 58e2fe3..726279f 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -839,6 +839,7 @@ config ARCH_OMAP
select ARCH_REQUIRE_GPIOLIB
select ARCH_HAS_CPUFREQ
select GENERIC_CLOCKEVENTS
+ select HAVE_SCHED_CLOCK
select ARCH_HAS_HOLES_MEMORYMODEL
help
Support for TI's OMAP platform (OMAP1/2/3/4).
diff --git a/arch/arm/plat-omap/counter_32k.c b/arch/arm/plat-omap/counter_32k.c
index aed301b..1b558ef 100644
--- a/arch/arm/plat-omap/counter_32k.c
+++ b/arch/arm/plat-omap/counter_32k.c
@@ -18,6 +18,8 @@
#include <linux/io.h>
#include <linux/sched.h>
+#include <asm/sched_clock.h>
+
#include <plat/common.h>
#include <plat/board.h>
@@ -110,10 +112,25 @@ static struct clocksource clocksource_32k = {
* Returns current time from boot in nsecs. It's OK for this to wrap
* around for now, as it's just a relative time stamp.
*/
+static DEFINE_CLOCK_DATA(cd);
+
+/*
+ * Constants generated by clocks_calc_mult_shift(m, s, 32768, NSEC_PER_SEC, 60).
+ * This gives a resolution of about 30us and a wrap period of about 36hrs.
+ */
+#define SC_MULT 4000000000u
+#define SC_SHIFT 17
+
unsigned long long notrace sched_clock(void)
{
- return clocksource_cyc2ns(clocksource_32k.read(&clocksource_32k),
- clocksource_32k.mult, clocksource_32k.shift);
+ u32 cyc = clocksource_32k.read(&clocksource_32k);
+ return cyc_to_fixed_sched_clock(&cd, cyc, (u32)~0, SC_MULT, SC_SHIFT);
+}
+
+static void notrace omap_update_sched_clock(void)
+{
+ u32 cyc = clocksource_32k.read(&clocksource_32k);
+ update_sched_clock(&cd, cyc, (u32)~0);
}
/**
@@ -171,6 +188,9 @@ static int __init omap_init_clocksource_32k(void)
if (clocksource_register_hz(&clocksource_32k, 32768))
printk(err, clocksource_32k.name);
+
+ init_fixed_sched_clock(&cd, omap_update_sched_clock, 32,
+ 32768, SC_MULT, SC_SHIFT);
}
return 0;
}
--
1.6.2.5
^ permalink raw reply related [flat|nested] 77+ messages in thread* [PATCH 38/40] ARM: orion: convert sched_clock() to use new infrastructure
2010-12-17 11:32 [PATCH 0/40] Complete set of clocksource/sched_clock patches Russell King - ARM Linux
` (36 preceding siblings ...)
2010-12-17 11:50 ` [PATCH 37/40] ARM: omap: " Russell King - ARM Linux
@ 2010-12-17 11:51 ` Russell King - ARM Linux
2010-12-17 19:49 ` Nicolas Pitre
2010-12-17 11:51 ` [PATCH 39/40] ARM: versatile: " Russell King - ARM Linux
` (10 subsequent siblings)
48 siblings, 1 reply; 77+ messages in thread
From: Russell King - ARM Linux @ 2010-12-17 11:51 UTC (permalink / raw)
To: linux-arm-kernel
Convert orion platforms to use the new sched_clock() infrastructure for
extending 32bit counters to full 64-bit nanoseconds.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
---
arch/arm/Kconfig | 1 +
arch/arm/plat-orion/time.c | 44 +++++++++-----------------------------------
2 files changed, 10 insertions(+), 35 deletions(-)
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 726279f..92e8c01 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -997,6 +997,7 @@ config PLAT_IOP
config PLAT_ORION
bool
+ select HAVE_SCHED_CLOCK
config PLAT_PXA
bool
diff --git a/arch/arm/plat-orion/time.c b/arch/arm/plat-orion/time.c
index 123f96f..c3da247 100644
--- a/arch/arm/plat-orion/time.c
+++ b/arch/arm/plat-orion/time.c
@@ -13,11 +13,11 @@
#include <linux/kernel.h>
#include <linux/sched.h>
-#include <linux/cnt32_to_63.h>
#include <linux/timer.h>
#include <linux/clockchips.h>
#include <linux/interrupt.h>
#include <linux/irq.h>
+#include <asm/sched_clock.h>
#include <asm/mach/time.h>
#include <mach/bridge-regs.h>
#include <mach/hardware.h>
@@ -44,52 +44,26 @@ static u32 ticks_per_jiffy;
/*
* Orion's sched_clock implementation. It has a resolution of
- * at least 7.5ns (133MHz TCLK) and a maximum value of 834 days.
- *
- * Because the hardware timer period is quite short (21 secs if
- * 200MHz TCLK) and because cnt32_to_63() needs to be called at
- * least once per half period to work properly, a kernel timer is
- * set up to ensure this requirement is always met.
+ * at least 7.5ns (133MHz TCLK).
*/
-#define TCLK2NS_SCALE_FACTOR 8
-
-static unsigned long tclk2ns_scale;
+static DEFINE_CLOCK_DATA(cd);
unsigned long long notrace sched_clock(void)
{
- unsigned long long v = cnt32_to_63(0xffffffff - readl(TIMER0_VAL));
- return (v * tclk2ns_scale) >> TCLK2NS_SCALE_FACTOR;
+ u32 cyc = 0xffffffff - readl(TIMER0_VAL);
+ return cyc_to_sched_clock(&cd, cyc, (u32)~0);
}
-static struct timer_list cnt32_to_63_keepwarm_timer;
-static void cnt32_to_63_keepwarm(unsigned long data)
+static void notrace orion_update_sched_clock(void)
{
- mod_timer(&cnt32_to_63_keepwarm_timer, round_jiffies(jiffies + data));
- (void) sched_clock();
+ u32 cyc = 0xffffffff - readl(TIMER0_VAL);
+ update_sched_clock(&cd, cyc, (u32)~0);
}
static void __init setup_sched_clock(unsigned long tclk)
{
- unsigned long long v;
- unsigned long data;
-
- v = NSEC_PER_SEC;
- v <<= TCLK2NS_SCALE_FACTOR;
- v += tclk/2;
- do_div(v, tclk);
- /*
- * We want an even value to automatically clear the top bit
- * returned by cnt32_to_63() without an additional run time
- * instruction. So if the LSB is 1 then round it up.
- */
- if (v & 1)
- v++;
- tclk2ns_scale = v;
-
- data = (0xffffffffUL / tclk / 2 - 2) * HZ;
- setup_timer(&cnt32_to_63_keepwarm_timer, cnt32_to_63_keepwarm, data);
- mod_timer(&cnt32_to_63_keepwarm_timer, round_jiffies(jiffies + data));
+ init_sched_clock(&cd, orion_update_sched_clock, 32, tclk);
}
/*
--
1.6.2.5
^ permalink raw reply related [flat|nested] 77+ messages in thread* [PATCH 38/40] ARM: orion: convert sched_clock() to use new infrastructure
2010-12-17 11:51 ` [PATCH 38/40] ARM: orion: " Russell King - ARM Linux
@ 2010-12-17 19:49 ` Nicolas Pitre
0 siblings, 0 replies; 77+ messages in thread
From: Nicolas Pitre @ 2010-12-17 19:49 UTC (permalink / raw)
To: linux-arm-kernel
On Fri, 17 Dec 2010, Russell King - ARM Linux wrote:
> Convert orion platforms to use the new sched_clock() infrastructure for
> extending 32bit counters to full 64-bit nanoseconds.
>
> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Acked-by: Nicolas Pitre <nico@fluxnic.net>
> ---
> arch/arm/Kconfig | 1 +
> arch/arm/plat-orion/time.c | 44 +++++++++-----------------------------------
> 2 files changed, 10 insertions(+), 35 deletions(-)
>
> diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
> index 726279f..92e8c01 100644
> --- a/arch/arm/Kconfig
> +++ b/arch/arm/Kconfig
> @@ -997,6 +997,7 @@ config PLAT_IOP
>
> config PLAT_ORION
> bool
> + select HAVE_SCHED_CLOCK
>
> config PLAT_PXA
> bool
> diff --git a/arch/arm/plat-orion/time.c b/arch/arm/plat-orion/time.c
> index 123f96f..c3da247 100644
> --- a/arch/arm/plat-orion/time.c
> +++ b/arch/arm/plat-orion/time.c
> @@ -13,11 +13,11 @@
>
> #include <linux/kernel.h>
> #include <linux/sched.h>
> -#include <linux/cnt32_to_63.h>
> #include <linux/timer.h>
> #include <linux/clockchips.h>
> #include <linux/interrupt.h>
> #include <linux/irq.h>
> +#include <asm/sched_clock.h>
> #include <asm/mach/time.h>
> #include <mach/bridge-regs.h>
> #include <mach/hardware.h>
> @@ -44,52 +44,26 @@ static u32 ticks_per_jiffy;
>
> /*
> * Orion's sched_clock implementation. It has a resolution of
> - * at least 7.5ns (133MHz TCLK) and a maximum value of 834 days.
> - *
> - * Because the hardware timer period is quite short (21 secs if
> - * 200MHz TCLK) and because cnt32_to_63() needs to be called at
> - * least once per half period to work properly, a kernel timer is
> - * set up to ensure this requirement is always met.
> + * at least 7.5ns (133MHz TCLK).
> */
> -#define TCLK2NS_SCALE_FACTOR 8
> -
> -static unsigned long tclk2ns_scale;
> +static DEFINE_CLOCK_DATA(cd);
>
> unsigned long long notrace sched_clock(void)
> {
> - unsigned long long v = cnt32_to_63(0xffffffff - readl(TIMER0_VAL));
> - return (v * tclk2ns_scale) >> TCLK2NS_SCALE_FACTOR;
> + u32 cyc = 0xffffffff - readl(TIMER0_VAL);
> + return cyc_to_sched_clock(&cd, cyc, (u32)~0);
> }
>
> -static struct timer_list cnt32_to_63_keepwarm_timer;
>
> -static void cnt32_to_63_keepwarm(unsigned long data)
> +static void notrace orion_update_sched_clock(void)
> {
> - mod_timer(&cnt32_to_63_keepwarm_timer, round_jiffies(jiffies + data));
> - (void) sched_clock();
> + u32 cyc = 0xffffffff - readl(TIMER0_VAL);
> + update_sched_clock(&cd, cyc, (u32)~0);
> }
>
> static void __init setup_sched_clock(unsigned long tclk)
> {
> - unsigned long long v;
> - unsigned long data;
> -
> - v = NSEC_PER_SEC;
> - v <<= TCLK2NS_SCALE_FACTOR;
> - v += tclk/2;
> - do_div(v, tclk);
> - /*
> - * We want an even value to automatically clear the top bit
> - * returned by cnt32_to_63() without an additional run time
> - * instruction. So if the LSB is 1 then round it up.
> - */
> - if (v & 1)
> - v++;
> - tclk2ns_scale = v;
> -
> - data = (0xffffffffUL / tclk / 2 - 2) * HZ;
> - setup_timer(&cnt32_to_63_keepwarm_timer, cnt32_to_63_keepwarm, data);
> - mod_timer(&cnt32_to_63_keepwarm_timer, round_jiffies(jiffies + data));
> + init_sched_clock(&cd, orion_update_sched_clock, 32, tclk);
> }
>
> /*
> --
> 1.6.2.5
>
^ permalink raw reply [flat|nested] 77+ messages in thread
* [PATCH 39/40] ARM: versatile: convert sched_clock() to use new infrastructure
2010-12-17 11:32 [PATCH 0/40] Complete set of clocksource/sched_clock patches Russell King - ARM Linux
` (37 preceding siblings ...)
2010-12-17 11:51 ` [PATCH 38/40] ARM: orion: " Russell King - ARM Linux
@ 2010-12-17 11:51 ` Russell King - ARM Linux
2010-12-17 11:51 ` [PATCH 40/40] ARM: vexpress: add sched_clock() for Versatile Express Russell King - ARM Linux
` (9 subsequent siblings)
48 siblings, 0 replies; 77+ messages in thread
From: Russell King - ARM Linux @ 2010-12-17 11:51 UTC (permalink / raw)
To: linux-arm-kernel
Convert versatile platforms to use the new sched_clock() infrastructure
for extending 32bit counters to full 64-bit nanoseconds.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
---
arch/arm/Kconfig | 2 +
arch/arm/mach-realview/core.c | 10 ++++
arch/arm/mach-versatile/core.c | 10 ++++
arch/arm/plat-versatile/include/plat/sched_clock.h | 6 +++
arch/arm/plat-versatile/sched-clock.c | 48 +++++++++++---------
5 files changed, 54 insertions(+), 22 deletions(-)
create mode 100644 arch/arm/plat-versatile/include/plat/sched_clock.h
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 92e8c01..34311f4 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -236,6 +236,7 @@ config ARCH_REALVIEW
bool "ARM Ltd. RealView family"
select ARM_AMBA
select COMMON_CLKDEV
+ select HAVE_SCHED_CLOCK
select ICST
select GENERIC_CLOCKEVENTS
select ARCH_WANT_OPTIONAL_GPIOLIB
@@ -250,6 +251,7 @@ config ARCH_VERSATILE
select ARM_AMBA
select ARM_VIC
select COMMON_CLKDEV
+ select HAVE_SCHED_CLOCK
select ICST
select GENERIC_CLOCKEVENTS
select ARCH_WANT_OPTIONAL_GPIOLIB
diff --git a/arch/arm/mach-realview/core.c b/arch/arm/mach-realview/core.c
index 07c0815..3d653e0 100644
--- a/arch/arm/mach-realview/core.c
+++ b/arch/arm/mach-realview/core.c
@@ -52,6 +52,8 @@
#include <mach/irqs.h>
#include <plat/timer-sp.h>
+#include <plat/sched_clock.h>
+
#include "core.h"
/* used by entry-macro.S and platsmp.c */
@@ -658,6 +660,12 @@ void realview_leds_event(led_event_t ledevt)
#endif /* CONFIG_LEDS */
/*
+ * The sched_clock counter
+ */
+#define REFCOUNTER (__io_address(REALVIEW_SYS_BASE) + \
+ REALVIEW_SYS_24MHz_OFFSET)
+
+/*
* Where is the timer (VA)?
*/
void __iomem *timer0_va_base;
@@ -672,6 +680,8 @@ void __init realview_timer_init(unsigned int timer_irq)
{
u32 val;
+ versatile_sched_clock_init(REFCOUNTER, 24000000);
+
/*
* set clock frequency:
* REALVIEW_REFCLK is 32KHz
diff --git a/arch/arm/mach-versatile/core.c b/arch/arm/mach-versatile/core.c
index e38acb0..56cdc22 100644
--- a/arch/arm/mach-versatile/core.c
+++ b/arch/arm/mach-versatile/core.c
@@ -51,6 +51,8 @@
#include <mach/platform.h>
#include <plat/timer-sp.h>
+#include <plat/sched_clock.h>
+
#include "core.h"
/*
@@ -886,6 +888,12 @@ void __init versatile_init(void)
}
/*
+ * The sched_clock counter
+ */
+#define REFCOUNTER (__io_address(VERSATILE_SYS_BASE) + \
+ VERSATILE_SYS_24MHz_OFFSET)
+
+/*
* Where is the timer (VA)?
*/
#define TIMER0_VA_BASE __io_address(VERSATILE_TIMER0_1_BASE)
@@ -900,6 +908,8 @@ static void __init versatile_timer_init(void)
{
u32 val;
+ versatile_sched_clock_init(REFCOUNTER, 24000000);
+
/*
* set clock frequency:
* VERSATILE_REFCLK is 32KHz
diff --git a/arch/arm/plat-versatile/include/plat/sched_clock.h b/arch/arm/plat-versatile/include/plat/sched_clock.h
new file mode 100644
index 0000000..5c3e4fc
--- /dev/null
+++ b/arch/arm/plat-versatile/include/plat/sched_clock.h
@@ -0,0 +1,6 @@
+#ifndef ARM_PLAT_SCHED_CLOCK_H
+#define ARM_PLAT_SCHED_CLOCK_H
+
+void versatile_sched_clock_init(void __iomem *, unsigned long);
+
+#endif
diff --git a/arch/arm/plat-versatile/sched-clock.c b/arch/arm/plat-versatile/sched-clock.c
index 42efd14..3d6a4c2 100644
--- a/arch/arm/plat-versatile/sched-clock.c
+++ b/arch/arm/plat-versatile/sched-clock.c
@@ -18,37 +18,41 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#include <linux/cnt32_to_63.h>
#include <linux/io.h>
#include <linux/sched.h>
-#include <asm/div64.h>
-#include <mach/hardware.h>
-#include <mach/platform.h>
+#include <asm/sched_clock.h>
+#include <plat/sched_clock.h>
-#ifdef VERSATILE_SYS_BASE
-#define REFCOUNTER (__io_address(VERSATILE_SYS_BASE) + VERSATILE_SYS_24MHz_OFFSET)
-#endif
-
-#ifdef REALVIEW_SYS_BASE
-#define REFCOUNTER (__io_address(REALVIEW_SYS_BASE) + REALVIEW_SYS_24MHz_OFFSET)
-#endif
+static DEFINE_CLOCK_DATA(cd);
+static void __iomem *ctr;
/*
- * This is the Realview and Versatile sched_clock implementation. This
- * has a resolution of 41.7ns, and a maximum value of about 35583 days.
- *
- * The return value is guaranteed to be monotonic in that range as
- * long as there is always less than 89 seconds between successive
- * calls to this function.
+ * Constants generated by clocks_calc_mult_shift(m, s, 24MHz, NSEC_PER_SEC, 60).
+ * This gives a resolution of about 41ns and a wrap period of about 178s.
*/
+#define SC_MULT 2796202667u
+#define SC_SHIFT 26
+
unsigned long long notrace sched_clock(void)
{
- unsigned long long v = cnt32_to_63(readl(REFCOUNTER));
+ if (ctr) {
+ u32 cyc = readl(ctr);
+ return cyc_to_fixed_sched_clock(&cd, cyc, (u32)~0,
+ SC_MULT, SC_SHIFT);
+ } else
+ return 0;
+}
- /* the <<1 gets rid of the cnt_32_to_63 top bit saving on a bic insn */
- v *= 125<<1;
- do_div(v, 3<<1);
+static void notrace versatile_update_sched_clock(void)
+{
+ u32 cyc = readl(ctr);
+ update_sched_clock(&cd, cyc, (u32)~0);
+}
- return v;
+void __init versatile_sched_clock_init(void __iomem *reg, unsigned long rate)
+{
+ ctr = reg;
+ init_fixed_sched_clock(&cd, versatile_update_sched_clock,
+ 32, rate, SC_MULT, SC_SHIFT);
}
--
1.6.2.5
^ permalink raw reply related [flat|nested] 77+ messages in thread* [PATCH 40/40] ARM: vexpress: add sched_clock() for Versatile Express
2010-12-17 11:32 [PATCH 0/40] Complete set of clocksource/sched_clock patches Russell King - ARM Linux
` (38 preceding siblings ...)
2010-12-17 11:51 ` [PATCH 39/40] ARM: versatile: " Russell King - ARM Linux
@ 2010-12-17 11:51 ` Russell King - ARM Linux
2010-12-17 14:04 ` [PATCH 0/40] Complete set of clocksource/sched_clock patches Santosh Shilimkar
` (8 subsequent siblings)
48 siblings, 0 replies; 77+ messages in thread
From: Russell King - ARM Linux @ 2010-12-17 11:51 UTC (permalink / raw)
To: linux-arm-kernel
Add a sched_clock() implementation to Versatile Express using the new
sched_clock() infrastructure for extending 32bit counters to full
64-bit nanoseconds.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
---
arch/arm/Kconfig | 1 +
arch/arm/mach-vexpress/v2m.c | 4 ++++
arch/arm/plat-versatile/Makefile | 4 +---
3 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 34311f4..17b5ff0 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -268,6 +268,7 @@ config ARCH_VEXPRESS
select COMMON_CLKDEV
select GENERIC_CLOCKEVENTS
select HAVE_CLK
+ select HAVE_SCHED_CLOCK
select ICST
select PLAT_VERSATILE
help
diff --git a/arch/arm/mach-vexpress/v2m.c b/arch/arm/mach-vexpress/v2m.c
index 7eaa232..8c28310 100644
--- a/arch/arm/mach-vexpress/v2m.c
+++ b/arch/arm/mach-vexpress/v2m.c
@@ -22,6 +22,8 @@
#include <mach/clkdev.h>
#include <mach/motherboard.h>
+#include <plat/sched_clock.h>
+
#include <plat/timer-sp.h>
#include "core.h"
@@ -50,6 +52,8 @@ void __init v2m_map_io(struct map_desc *tile, size_t num)
static void __init v2m_timer_init(void)
{
+ versatile_sched_clock_init(MMIO_P2V(V2M_SYS_24MHZ), 24000000);
+
writel(0, MMIO_P2V(V2M_TIMER0) + TIMER_CTRL);
writel(0, MMIO_P2V(V2M_TIMER1) + TIMER_CTRL);
diff --git a/arch/arm/plat-versatile/Makefile b/arch/arm/plat-versatile/Makefile
index 5cf88e8..230eb37 100644
--- a/arch/arm/plat-versatile/Makefile
+++ b/arch/arm/plat-versatile/Makefile
@@ -1,7 +1,5 @@
-obj-y := clock.o
+obj-y := clock.o sched-clock.o
obj-$(CONFIG_ARM_TIMER_SP804) += timer-sp.o
-obj-$(CONFIG_ARCH_REALVIEW) += sched-clock.o
-obj-$(CONFIG_ARCH_VERSATILE) += sched-clock.o
ifeq ($(CONFIG_LEDS_CLASS),y)
obj-$(CONFIG_ARCH_REALVIEW) += leds.o
obj-$(CONFIG_ARCH_VERSATILE) += leds.o
--
1.6.2.5
^ permalink raw reply related [flat|nested] 77+ messages in thread* [PATCH 0/40] Complete set of clocksource/sched_clock patches
2010-12-17 11:32 [PATCH 0/40] Complete set of clocksource/sched_clock patches Russell King - ARM Linux
` (39 preceding siblings ...)
2010-12-17 11:51 ` [PATCH 40/40] ARM: vexpress: add sched_clock() for Versatile Express Russell King - ARM Linux
@ 2010-12-17 14:04 ` Santosh Shilimkar
2010-12-17 16:03 ` Will Deacon
` (7 subsequent siblings)
48 siblings, 0 replies; 77+ messages in thread
From: Santosh Shilimkar @ 2010-12-17 14:04 UTC (permalink / raw)
To: linux-arm-kernel
> -----Original Message-----
> From: linux-omap-owner at vger.kernel.org [mailto:linux-omap-
> owner at vger.kernel.org] On Behalf Of Russell King - ARM Linux
> Sent: Friday, December 17, 2010 5:02 PM
> To: Alessandro Rubini; Bryan Huntsman; Colin Cross; Daniel Walker; David
> Brown; Eric Miao; Erik Gilling; Hans J. Koch; Imre Kaloz; Kevin Hilman;
> Krzysztof Halasa; Kukjin Kim; Lennert Buytenhek; Jiandong Zheng; Linus
> Walleij; linux-arm-msm at vger.kernel.org; linux-omap at vger.kernel.org;
linux-
> samsung-soc at vger.kernel.org; linux-tegra at vger.kernel.org; Nicolas Pitre;
> Olof Johansson; Sascha Hauer; Scott Branden; STEricsson; Tony Lindgren;
> Viresh Kumar; Wan ZongShun
> Cc: linux-arm-kernel at lists.infradead.org
> Subject: [PATCH 0/40] Complete set of clocksource/sched_clock patches
>
> Here is the entire set of clocksource and sched_clock patches which
> have been previously posted. There's a couple of small tweaks in a
> few of the patches (such as adding notrace to OMAP clocksource read
> functions), and this also shows the proper ordering of these patches.
>
> Still looking for acks or tested-by's for these patches.
Have boot tested this series on OMAP4430 SDP and OMAP3630
ZOOM.
Tested-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Regards,
Santosh
^ permalink raw reply [flat|nested] 77+ messages in thread* [PATCH 0/40] Complete set of clocksource/sched_clock patches
2010-12-17 11:32 [PATCH 0/40] Complete set of clocksource/sched_clock patches Russell King - ARM Linux
` (40 preceding siblings ...)
2010-12-17 14:04 ` [PATCH 0/40] Complete set of clocksource/sched_clock patches Santosh Shilimkar
@ 2010-12-17 16:03 ` Will Deacon
2010-12-19 10:37 ` Mikael Pettersson
` (6 subsequent siblings)
48 siblings, 0 replies; 77+ messages in thread
From: Will Deacon @ 2010-12-17 16:03 UTC (permalink / raw)
To: linux-arm-kernel
Hi Russell,
> Here is the entire set of clocksource and sched_clock patches which
> have been previously posted. There's a couple of small tweaks in a
> few of the patches (such as adding notrace to OMAP clocksource read
> functions), and this also shows the proper ordering of these patches.
>
> Still looking for acks or tested-by's for these patches.
I took these for a spin on my Versatile Express board and it seems
happy enough doing parallel builds with all the CPUs fully loaded.
Tested-by: Will Deacon <will.deacon@arm.com>
I don't think these conflict with the multi-tile patch I sent to the
patch system, but if you see a conflict please let me know.
Will
^ permalink raw reply [flat|nested] 77+ messages in thread* [PATCH 0/40] Complete set of clocksource/sched_clock patches
2010-12-17 11:32 [PATCH 0/40] Complete set of clocksource/sched_clock patches Russell King - ARM Linux
` (41 preceding siblings ...)
2010-12-17 16:03 ` Will Deacon
@ 2010-12-19 10:37 ` Mikael Pettersson
2010-12-19 10:52 ` Russell King - ARM Linux
2010-12-20 3:32 ` Eric Miao
` (5 subsequent siblings)
48 siblings, 1 reply; 77+ messages in thread
From: Mikael Pettersson @ 2010-12-19 10:37 UTC (permalink / raw)
To: linux-arm-kernel
Russell King - ARM Linux writes:
> Here is the entire set of clocksource and sched_clock patches which
> have been previously posted. There's a couple of small tweaks in a
> few of the patches (such as adding notrace to OMAP clocksource read
> functions), and this also shows the proper ordering of these patches.
>
> Still looking for acks or tested-by's for these patches.
Which tree is this based on? Is this scheduled for 2.6.37 or .38?
Since the problem affects 2.6.37-rc I tried it on top of 2.6.37-rc6.
First there were patch rejects in two sub-archs, but they were easily
fixed.
On n2100 (plat-iop) a missing #include <asm/sched_clock.h> in
plat-iop/time.c caused a compile error. With that added the kernel
built w/o warnings but hung immediately after being decompressed.
On mach-ixp4xx the kernel built and booted fine, and the interactivity
problems were gone.
Tested-by: Mikael Pettersson <mikpe@it.uu.se> (IXP4xx only)
^ permalink raw reply [flat|nested] 77+ messages in thread* [PATCH 0/40] Complete set of clocksource/sched_clock patches
2010-12-19 10:37 ` Mikael Pettersson
@ 2010-12-19 10:52 ` Russell King - ARM Linux
2010-12-19 10:56 ` Russell King - ARM Linux
2010-12-19 12:33 ` Mikael Pettersson
0 siblings, 2 replies; 77+ messages in thread
From: Russell King - ARM Linux @ 2010-12-19 10:52 UTC (permalink / raw)
To: linux-arm-kernel
On Sun, Dec 19, 2010 at 11:37:27AM +0100, Mikael Pettersson wrote:
> Russell King - ARM Linux writes:
> > Here is the entire set of clocksource and sched_clock patches which
> > have been previously posted. There's a couple of small tweaks in a
> > few of the patches (such as adding notrace to OMAP clocksource read
> > functions), and this also shows the proper ordering of these patches.
> >
> > Still looking for acks or tested-by's for these patches.
>
> Which tree is this based on? Is this scheduled for 2.6.37 or .38?
It's based on the point where the ftrace updates were merged into my
tree. I can't produce all the patches that lead up to this set because
there's just too many.
However, it probably applies cleanly on top of the devel-stable stuff.
It's scheduled for the next merge window.
> On n2100 (plat-iop) a missing #include <asm/sched_clock.h> in
> plat-iop/time.c caused a compile error. With that added the kernel
> built w/o warnings but hung immediately after being decompressed.
Will add the missing include.
Normally, this is because sched_clock() is called prior to the mapping
for reading the counter being available, but this is no different from
what was already there. So, I suspect that n2100 doesn't boot without
these patches applied either.
Any chance of an boot log using the early printk or debug_ll stuff?
> On mach-ixp4xx the kernel built and booted fine, and the interactivity
> problems were gone.
>
> Tested-by: Mikael Pettersson <mikpe@it.uu.se> (IXP4xx only)
Thanks - will add that to the IXP4xx specific parts.
^ permalink raw reply [flat|nested] 77+ messages in thread
* [PATCH 0/40] Complete set of clocksource/sched_clock patches
2010-12-19 10:52 ` Russell King - ARM Linux
@ 2010-12-19 10:56 ` Russell King - ARM Linux
2010-12-19 12:16 ` Mikael Pettersson
2010-12-19 12:33 ` Mikael Pettersson
1 sibling, 1 reply; 77+ messages in thread
From: Russell King - ARM Linux @ 2010-12-19 10:56 UTC (permalink / raw)
To: linux-arm-kernel
On Sun, Dec 19, 2010 at 10:52:09AM +0000, Russell King - ARM Linux wrote:
> > On mach-ixp4xx the kernel built and booted fine, and the interactivity
> > problems were gone.
> >
> > Tested-by: Mikael Pettersson <mikpe@it.uu.se> (IXP4xx only)
>
> Thanks - will add that to the IXP4xx specific parts.
BTW, can I add that to the common parts as well?
^ permalink raw reply [flat|nested] 77+ messages in thread
* [PATCH 0/40] Complete set of clocksource/sched_clock patches
2010-12-19 10:56 ` Russell King - ARM Linux
@ 2010-12-19 12:16 ` Mikael Pettersson
0 siblings, 0 replies; 77+ messages in thread
From: Mikael Pettersson @ 2010-12-19 12:16 UTC (permalink / raw)
To: linux-arm-kernel
Russell King - ARM Linux writes:
> On Sun, Dec 19, 2010 at 10:52:09AM +0000, Russell King - ARM Linux wrote:
> > > On mach-ixp4xx the kernel built and booted fine, and the interactivity
> > > problems were gone.
> > >
> > > Tested-by: Mikael Pettersson <mikpe@it.uu.se> (IXP4xx only)
> >
> > Thanks - will add that to the IXP4xx specific parts.
>
> BTW, can I add that to the common parts as well?
Sure.
^ permalink raw reply [flat|nested] 77+ messages in thread
* [PATCH 0/40] Complete set of clocksource/sched_clock patches
2010-12-19 10:52 ` Russell King - ARM Linux
2010-12-19 10:56 ` Russell King - ARM Linux
@ 2010-12-19 12:33 ` Mikael Pettersson
2010-12-19 12:55 ` Russell King - ARM Linux
1 sibling, 1 reply; 77+ messages in thread
From: Mikael Pettersson @ 2010-12-19 12:33 UTC (permalink / raw)
To: linux-arm-kernel
Russell King - ARM Linux writes:
> On Sun, Dec 19, 2010 at 11:37:27AM +0100, Mikael Pettersson wrote:
> > Russell King - ARM Linux writes:
> > > Here is the entire set of clocksource and sched_clock patches which
> > > have been previously posted. There's a couple of small tweaks in a
> > > few of the patches (such as adding notrace to OMAP clocksource read
> > > functions), and this also shows the proper ordering of these patches.
> > >
> > > Still looking for acks or tested-by's for these patches.
> >
> > Which tree is this based on? Is this scheduled for 2.6.37 or .38?
>
> It's based on the point where the ftrace updates were merged into my
> tree. I can't produce all the patches that lead up to this set because
> there's just too many.
>
> However, it probably applies cleanly on top of the devel-stable stuff.
>
> It's scheduled for the next merge window.
>
> > On n2100 (plat-iop) a missing #include <asm/sched_clock.h> in
> > plat-iop/time.c caused a compile error. With that added the kernel
> > built w/o warnings but hung immediately after being decompressed.
>
> Will add the missing include.
>
> Normally, this is because sched_clock() is called prior to the mapping
> for reading the counter being available, but this is no different from
> what was already there. So, I suspect that n2100 doesn't boot without
> these patches applied either.
The n2100 boots just fine without the sched_clock patches.
> Any chance of an boot log using the early printk or debug_ll stuff?
Here it is:
Build ATAG
ATAG_MEM: Overwrite ram_end with real_region_top=0x20000000, memsize=512 M
ATAG_MEM=536870912 at 0xa0000000, MACH_TYPE=1101
Using base address 0x00200000 and length 0x0018e3c0
Uncompressing Linux... done, booting the kernel.
Linux version 2.6.37-rc6 (mikpe at brewer) (gcc version 4.4.6 20101116 (prerelease) (GCC) ) #1 Sun Dec 19 12:58:45 CET 2010
CPU: XScale-80219 [69052e30] revision 0 (ARMv5TE), cr=0000397f
CPU: VIVT data cache, VIVT instruction cache
Machine: Thecus N2100
bootconsole [earlycon0] enabled
Memory policy: ECC disabled, Data cache writeback
pcpu-alloc: s0 r0 d32768 u32768 alloc=1*32768
pcpu-alloc: [0] 0
Built 1 zonelists in Zone order, mobility grouping on. Total pages: 130048
Kernel command line: console=ttyS0,115200 ro root=/dev/sda1 mem=512M at 0xa0000000 earlyprintk
PID hash table entries: 2048 (order: 1, 8192 bytes)
Dentry cache hash table entries: 65536 (order: 6, 262144 bytes)
Inode-cache hash table entries: 32768 (order: 5, 131072 bytes)
Memory: 512MB = 512MB total
Memory: 516424k/516424k available, 7864k reserved, 0K highmem
Virtual kernel memory layout:
vector : 0xffff0000 - 0xffff1000 ( 4 kB)
fixmap : 0xfff00000 - 0xfffe0000 ( 896 kB)
DMA : 0xffc00000 - 0xffe00000 ( 2 MB)
vmalloc : 0xe0800000 - 0xfe000000 ( 472 MB)
lowmem : 0xc0000000 - 0xe0000000 ( 512 MB)
modules : 0xbf000000 - 0xc0000000 ( 16 MB)
.init : 0xc0008000 - 0xc0022000 ( 104 kB)
.text : 0xc0022000 - 0xc030d000 (2988 kB)
.data : 0xc030e000 - 0xc0329d60 ( 112 kB)
NR_IRQS:32
sched_clock: 32 bits at 198MHz, resolution 5ns, wraps every 21691ms
Unable to handle kernel NULL pointer dereference at virtual address 00000000
pgd = c0004000
[00000000] *pgd=00000000
Internal error: Oops: 80000005 [#1]
last sysfs file:
Modules linked in:
CPU: 0 Not tainted (2.6.37-rc6 #1)
PC is at 0x0
LR is at iop_timer_interrupt+0x20/0x28
pc : [<00000000>] lr : [<c002b580>] psr: 400000d3
sp : c030fe98 ip : c030fea8 fp : c030fea4
r10: a001c494 r9 : 69052e30 r8 : c0315a8c
r7 : 00000009 r6 : 00000000 r5 : 00000000 r4 : c0312fa0
r3 : 00000000 r2 : 00000001 r1 : c0312fc8 r0 : c0312fc8
Flags: nZcv IRQs off FIQs off Mode SVC_32 ISA ARM Segment kernel
Control: 0000397f Table: a0004000 DAC: 00000017
Process swapper (pid: 0, stack limit = 0xc030e270)
Stack: (0xc030fe98 to 0xc0310000)
fe80: c030fec4 c030fea8
fea0: c005ebfc c002b56c c0315a68 00000009 00000200 60000053 c030fedc c030fec8
fec0: c0060e78 c005ebdc 00000009 00000000 c030fef4 c030fee0 c002207c c0060dd8
fee0: ffffffff c030ff2c c030ff6c c030fef8 c0022ba8 c002200c 00000000 00000001
ff00: 00000000 00000000 c0315a68 c0312fa0 00000009 60000053 c0315a8c 69052e30
ff20: a001c494 c030ff6c c030ff08 c030ff40 c00603e0 c005f7cc 60000053 ffffffff
ff40: 52ef041b 00000001 c0312fa0 00000009 c001d9e4 c0311a58 a001c704 a001c494
ff60: c030ff84 c030ff70 c005fa54 c005f598 c0312fa0 0bcd3d80 c030ffac c030ff88
ff80: c000c3a4 c005fa38 c0315560 600000d3 c0330020 c0329d60 c001d9e8 c001d9e4
ffa0: c030ffbc c030ffb0 c000bee4 c000c358 c030ffcc c030ffc0 c0009f54 c000bedc
ffc0: c030fff4 c030ffd0 c0008a1c c0009f44 c000865c 00000000 00000000 c001d9e8
ffe0: 0000397d c0329e64 00000000 c030fff8 a0008034 c00088b8 00000000 00000000
Backtrace:
[<c002b560>] (iop_timer_interrupt+0x0/0x28) from [<c005ebfc>] (handle_IRQ_event+0x2c/0xfc)
[<c005ebd0>] (handle_IRQ_event+0x0/0xfc) from [<c0060e78>] (handle_level_irq+0xac/0x11c)
r7:60000053 r6:00000200 r5:00000009 r4:c0315a68
[<c0060dcc>] (handle_level_irq+0x0/0x11c) from [<c002207c>] (asm_do_IRQ+0x7c/0xa0)
r5:00000000 r4:00000009
[<c0022000>] (asm_do_IRQ+0x0/0xa0) from [<c0022ba8>] (__irq_svc+0x48/0x80)
Exception stack(0xc030fef8 to 0xc030ff40)
fee0: 00000000 00000001
ff00: 00000000 00000000 c0315a68 c0312fa0 00000009 60000053 c0315a8c 69052e30
ff20: a001c494 c030ff6c c030ff08 c030ff40 c00603e0 c005f7cc 60000053 ffffffff
r5:c030ff2c r4:ffffffff
[<c005f58c>] (__setup_irq+0x0/0x310) from [<c005fa54>] (setup_irq+0x28/0x2c)
[<c005fa2c>] (setup_irq+0x0/0x2c) from [<c000c3a4>] (iop_init_time+0x58/0x108)
r5:0bcd3d80 r4:c0312fa0
[<c000c34c>] (iop_init_time+0x0/0x108) from [<c000bee4>] (n2100_timer_init+0x14/0x1c)
r6:c001d9e4 r5:c001d9e8 r4:c0329d60
[<c000bed0>] (n2100_timer_init+0x0/0x1c) from [<c0009f54>] (time_init+0x1c/0x24)
[<c0009f38>] (time_init+0x0/0x24) from [<c0008a1c>] (start_kernel+0x170/0x264)
[<c00088ac>] (start_kernel+0x0/0x264) from [<a0008034>] (0xa0008034)
r5:c0329e64 r4:0000397d
Code: bad PC value
---[ end trace 1b75b31a2719ed1c ]---
Kernel panic - not syncing: Fatal exception in interrupt
Backtrace:
[<c0026314>] (dump_backtrace+0x0/0x118) from [<c025b65c>] (dump_stack+0x18/0x1c)
r7:00000000 r6:c030e270 r5:c032a030 r4:c032a030
[<c025b644>] (dump_stack+0x0/0x1c) from [<c025b6c4>] (panic+0x64/0x188)
[<c025b660>] (panic+0x0/0x188) from [<c0026758>] (die+0x194/0x1d8)
r3:00010000 r2:c030fcf8 r1:00001315 r0:c02ca1bf
r7:00000000
[<c00265c4>] (die+0x0/0x1d8) from [<c00285d8>] (__do_kernel_fault+0x6c/0x90)
r8:00000000 r7:80000005 r6:00000000 r5:c030fe50 r4:00000000
[<c002856c>] (__do_kernel_fault+0x0/0x90) from [<c00287b8>] (do_page_fault+0x1bc/0x1d4)
r9:000000d3 r8:00000000 r7:00000000 r6:00000000 r5:c030fe50
r4:c0310df8
[<c00285fc>] (do_page_fault+0x0/0x1d4) from [<c0028868>] (do_translation_fault+0x24/0xac)
[<c0028844>] (do_translation_fault+0x0/0xac) from [<c0022230>] (do_PrefetchAbort+0x3c/0xa0)
r7:c030fe50 r6:00000000 r5:c0311e5c r4:00000005
[<c00221f4>] (do_PrefetchAbort+0x0/0xa0) from [<c0022c90>] (__pabt_svc+0x50/0x80)
Exception stack(0xc030fe50 to 0xc030fe98)
fe40: c0312fc8 c0312fc8 00000001 00000000
fe60: c0312fa0 00000000 00000000 00000009 c0315a8c 69052e30 a001c494 c030fea4
fe80: c030fea8 c030fe98 c002b580 00000000 400000d3 ffffffff
r7:00000009 r6:00000000 r5:c030fe84 r4:ffffffff
[<c002b560>] (iop_timer_interrupt+0x0/0x28) from [<c005ebfc>] (handle_IRQ_event+0x2c/0xfc)
[<c005ebd0>] (handle_IRQ_event+0x0/0xfc) from [<c0060e78>] (handle_level_irq+0xac/0x11c)
r7:60000053 r6:00000200 r5:00000009 r4:c0315a68
[<c0060dcc>] (handle_level_irq+0x0/0x11c) from [<c002207c>] (asm_do_IRQ+0x7c/0xa0)
r5:00000000 r4:00000009
[<c0022000>] (asm_do_IRQ+0x0/0xa0) from [<c0022ba8>] (__irq_svc+0x48/0x80)
Exception stack(0xc030fef8 to 0xc030ff40)
fee0: 00000000 00000001
ff00: 00000000 00000000 c0315a68 c0312fa0 00000009 60000053 c0315a8c 69052e30
ff20: a001c494 c030ff6c c030ff08 c030ff40 c00603e0 c005f7cc 60000053 ffffffff
r5:c030ff2c r4:ffffffff
[<c005f58c>] (__setup_irq+0x0/0x310) from [<c005fa54>] (setup_irq+0x28/0x2c)
[<c005fa2c>] (setup_irq+0x0/0x2c) from [<c000c3a4>] (iop_init_time+0x58/0x108)
r5:0bcd3d80 r4:c0312fa0
[<c000c34c>] (iop_init_time+0x0/0x108) from [<c000bee4>] (n2100_timer_init+0x14/0x1c)
r6:c001d9e4 r5:c001d9e8 r4:c0329d60
[<c000bed0>] (n2100_timer_init+0x0/0x1c) from [<c0009f54>] (time_init+0x1c/0x24)
[<c0009f38>] (time_init+0x0/0x24) from [<c0008a1c>] (start_kernel+0x170/0x264)
[<c00088ac>] (start_kernel+0x0/0x264) from [<a0008034>] (0xa0008034)
r5:c0329e64 r4:0000397d
We take an early timer interrupt and call NULL in the
evt->event_handler(evt);
statement in iop_timer_interrupt(). Apparently the evt (dev_id) passed
to the interrupt handler isn't initialized at this point.
The most visible change the sched_clock patches did in plat-iop was to add
a call to init_sched_clock() at the very start of iop_init_time(), before
the timer IRQ, clockevent, and clocksource have been set up. Moving that call
to the very end of iop_init_time() [see below] made the kernel boot again,
and the interactivity problems were also solved.
With the update below,
Tested-by: Mikael Pettersson <mikpe@it.uu.se> (mach-iop32x/plat-iop)
--- linux-2.6.37-rc6/arch/arm/plat-iop/time.c.~1~ 2010-12-19 12:55:26.000000000 +0100
+++ linux-2.6.37-rc6/arch/arm/plat-iop/time.c 2010-12-19 13:07:14.000000000 +0100
@@ -151,8 +151,6 @@ void __init iop_init_time(unsigned long
{
u32 timer_ctl;
- init_sched_clock(&cd, iop_update_sched_clock, 32, tick_rate);
-
ticks_per_jiffy = DIV_ROUND_CLOSEST(tick_rate, HZ);
iop_tick_rate = tick_rate;
@@ -183,4 +181,6 @@ void __init iop_init_time(unsigned long
write_tcr1(0xffffffff);
write_tmr1(timer_ctl);
clocksource_register_hz(&iop_clocksource, tick_rate);
+
+ init_sched_clock(&cd, iop_update_sched_clock, 32, tick_rate);
}
^ permalink raw reply [flat|nested] 77+ messages in thread* [PATCH 0/40] Complete set of clocksource/sched_clock patches
2010-12-19 12:33 ` Mikael Pettersson
@ 2010-12-19 12:55 ` Russell King - ARM Linux
2010-12-19 14:05 ` Mikael Pettersson
0 siblings, 1 reply; 77+ messages in thread
From: Russell King - ARM Linux @ 2010-12-19 12:55 UTC (permalink / raw)
To: linux-arm-kernel
On Sun, Dec 19, 2010 at 01:33:32PM +0100, Mikael Pettersson wrote:
> Here it is:
>
> Build ATAG
> ATAG_MEM: Overwrite ram_end with real_region_top=0x20000000, memsize=512 M
> ATAG_MEM=536870912 at 0xa0000000, MACH_TYPE=1101
> Using base address 0x00200000 and length 0x0018e3c0
> Uncompressing Linux... done, booting the kernel.
> Linux version 2.6.37-rc6 (mikpe at brewer) (gcc version 4.4.6 20101116 (prerelease) (GCC) ) #1 Sun Dec 19 12:58:45 CET 2010
> CPU: XScale-80219 [69052e30] revision 0 (ARMv5TE), cr=0000397f
> CPU: VIVT data cache, VIVT instruction cache
> Machine: Thecus N2100
> bootconsole [earlycon0] enabled
> Memory policy: ECC disabled, Data cache writeback
> pcpu-alloc: s0 r0 d32768 u32768 alloc=1*32768
> pcpu-alloc: [0] 0
> Built 1 zonelists in Zone order, mobility grouping on. Total pages: 130048
> Kernel command line: console=ttyS0,115200 ro root=/dev/sda1 mem=512M at 0xa0000000 earlyprintk
> PID hash table entries: 2048 (order: 1, 8192 bytes)
> Dentry cache hash table entries: 65536 (order: 6, 262144 bytes)
> Inode-cache hash table entries: 32768 (order: 5, 131072 bytes)
> Memory: 512MB = 512MB total
> Memory: 516424k/516424k available, 7864k reserved, 0K highmem
> Virtual kernel memory layout:
> vector : 0xffff0000 - 0xffff1000 ( 4 kB)
> fixmap : 0xfff00000 - 0xfffe0000 ( 896 kB)
> DMA : 0xffc00000 - 0xffe00000 ( 2 MB)
> vmalloc : 0xe0800000 - 0xfe000000 ( 472 MB)
> lowmem : 0xc0000000 - 0xe0000000 ( 512 MB)
> modules : 0xbf000000 - 0xc0000000 ( 16 MB)
> .init : 0xc0008000 - 0xc0022000 ( 104 kB)
> .text : 0xc0022000 - 0xc030d000 (2988 kB)
> .data : 0xc030e000 - 0xc0329d60 ( 112 kB)
> NR_IRQS:32
> sched_clock: 32 bits at 198MHz, resolution 5ns, wraps every 21691ms
> Unable to handle kernel NULL pointer dereference at virtual address 00000000
> pgd = c0004000
> [00000000] *pgd=00000000
> Internal error: Oops: 80000005 [#1]
> last sysfs file:
> Modules linked in:
> CPU: 0 Not tainted (2.6.37-rc6 #1)
> PC is at 0x0
> LR is at iop_timer_interrupt+0x20/0x28
> pc : [<00000000>] lr : [<c002b580>] psr: 400000d3
> sp : c030fe98 ip : c030fea8 fp : c030fea4
> r10: a001c494 r9 : 69052e30 r8 : c0315a8c
> r7 : 00000009 r6 : 00000000 r5 : 00000000 r4 : c0312fa0
> r3 : 00000000 r2 : 00000001 r1 : c0312fc8 r0 : c0312fc8
> Flags: nZcv IRQs off FIQs off Mode SVC_32 ISA ARM Segment kernel
> Control: 0000397f Table: a0004000 DAC: 00000017
> Process swapper (pid: 0, stack limit = 0xc030e270)
> Stack: (0xc030fe98 to 0xc0310000)
> fe80: c030fec4 c030fea8
> fea0: c005ebfc c002b56c c0315a68 00000009 00000200 60000053 c030fedc c030fec8
> fec0: c0060e78 c005ebdc 00000009 00000000 c030fef4 c030fee0 c002207c c0060dd8
> fee0: ffffffff c030ff2c c030ff6c c030fef8 c0022ba8 c002200c 00000000 00000001
> ff00: 00000000 00000000 c0315a68 c0312fa0 00000009 60000053 c0315a8c 69052e30
> ff20: a001c494 c030ff6c c030ff08 c030ff40 c00603e0 c005f7cc 60000053 ffffffff
> ff40: 52ef041b 00000001 c0312fa0 00000009 c001d9e4 c0311a58 a001c704 a001c494
> ff60: c030ff84 c030ff70 c005fa54 c005f598 c0312fa0 0bcd3d80 c030ffac c030ff88
> ff80: c000c3a4 c005fa38 c0315560 600000d3 c0330020 c0329d60 c001d9e8 c001d9e4
> ffa0: c030ffbc c030ffb0 c000bee4 c000c358 c030ffcc c030ffc0 c0009f54 c000bedc
> ffc0: c030fff4 c030ffd0 c0008a1c c0009f44 c000865c 00000000 00000000 c001d9e8
> ffe0: 0000397d c0329e64 00000000 c030fff8 a0008034 c00088b8 00000000 00000000
> Backtrace:
> [<c002b560>] (iop_timer_interrupt+0x0/0x28) from [<c005ebfc>] (handle_IRQ_event+0x2c/0xfc)
> [<c005ebd0>] (handle_IRQ_event+0x0/0xfc) from [<c0060e78>] (handle_level_irq+0xac/0x11c)
> r7:60000053 r6:00000200 r5:00000009 r4:c0315a68
> [<c0060dcc>] (handle_level_irq+0x0/0x11c) from [<c002207c>] (asm_do_IRQ+0x7c/0xa0)
> r5:00000000 r4:00000009
> [<c0022000>] (asm_do_IRQ+0x0/0xa0) from [<c0022ba8>] (__irq_svc+0x48/0x80)
> Exception stack(0xc030fef8 to 0xc030ff40)
> fee0: 00000000 00000001
> ff00: 00000000 00000000 c0315a68 c0312fa0 00000009 60000053 c0315a8c 69052e30
> ff20: a001c494 c030ff6c c030ff08 c030ff40 c00603e0 c005f7cc 60000053 ffffffff
> r5:c030ff2c r4:ffffffff
> [<c005f58c>] (__setup_irq+0x0/0x310) from [<c005fa54>] (setup_irq+0x28/0x2c)
> [<c005fa2c>] (setup_irq+0x0/0x2c) from [<c000c3a4>] (iop_init_time+0x58/0x108)
> r5:0bcd3d80 r4:c0312fa0
> [<c000c34c>] (iop_init_time+0x0/0x108) from [<c000bee4>] (n2100_timer_init+0x14/0x1c)
> r6:c001d9e4 r5:c001d9e8 r4:c0329d60
> [<c000bed0>] (n2100_timer_init+0x0/0x1c) from [<c0009f54>] (time_init+0x1c/0x24)
> [<c0009f38>] (time_init+0x0/0x24) from [<c0008a1c>] (start_kernel+0x170/0x264)
> [<c00088ac>] (start_kernel+0x0/0x264) from [<a0008034>] (0xa0008034)
> r5:c0329e64 r4:0000397d
> Code: bad PC value
> ---[ end trace 1b75b31a2719ed1c ]---
> Kernel panic - not syncing: Fatal exception in interrupt
> Backtrace:
> [<c0026314>] (dump_backtrace+0x0/0x118) from [<c025b65c>] (dump_stack+0x18/0x1c)
> r7:00000000 r6:c030e270 r5:c032a030 r4:c032a030
> [<c025b644>] (dump_stack+0x0/0x1c) from [<c025b6c4>] (panic+0x64/0x188)
> [<c025b660>] (panic+0x0/0x188) from [<c0026758>] (die+0x194/0x1d8)
> r3:00010000 r2:c030fcf8 r1:00001315 r0:c02ca1bf
> r7:00000000
> [<c00265c4>] (die+0x0/0x1d8) from [<c00285d8>] (__do_kernel_fault+0x6c/0x90)
> r8:00000000 r7:80000005 r6:00000000 r5:c030fe50 r4:00000000
> [<c002856c>] (__do_kernel_fault+0x0/0x90) from [<c00287b8>] (do_page_fault+0x1bc/0x1d4)
> r9:000000d3 r8:00000000 r7:00000000 r6:00000000 r5:c030fe50
> r4:c0310df8
> [<c00285fc>] (do_page_fault+0x0/0x1d4) from [<c0028868>] (do_translation_fault+0x24/0xac)
> [<c0028844>] (do_translation_fault+0x0/0xac) from [<c0022230>] (do_PrefetchAbort+0x3c/0xa0)
> r7:c030fe50 r6:00000000 r5:c0311e5c r4:00000005
> [<c00221f4>] (do_PrefetchAbort+0x0/0xa0) from [<c0022c90>] (__pabt_svc+0x50/0x80)
> Exception stack(0xc030fe50 to 0xc030fe98)
> fe40: c0312fc8 c0312fc8 00000001 00000000
> fe60: c0312fa0 00000000 00000000 00000009 c0315a8c 69052e30 a001c494 c030fea4
> fe80: c030fea8 c030fe98 c002b580 00000000 400000d3 ffffffff
> r7:00000009 r6:00000000 r5:c030fe84 r4:ffffffff
> [<c002b560>] (iop_timer_interrupt+0x0/0x28) from [<c005ebfc>] (handle_IRQ_event+0x2c/0xfc)
> [<c005ebd0>] (handle_IRQ_event+0x0/0xfc) from [<c0060e78>] (handle_level_irq+0xac/0x11c)
> r7:60000053 r6:00000200 r5:00000009 r4:c0315a68
> [<c0060dcc>] (handle_level_irq+0x0/0x11c) from [<c002207c>] (asm_do_IRQ+0x7c/0xa0)
> r5:00000000 r4:00000009
> [<c0022000>] (asm_do_IRQ+0x0/0xa0) from [<c0022ba8>] (__irq_svc+0x48/0x80)
> Exception stack(0xc030fef8 to 0xc030ff40)
> fee0: 00000000 00000001
> ff00: 00000000 00000000 c0315a68 c0312fa0 00000009 60000053 c0315a8c 69052e30
> ff20: a001c494 c030ff6c c030ff08 c030ff40 c00603e0 c005f7cc 60000053 ffffffff
> r5:c030ff2c r4:ffffffff
> [<c005f58c>] (__setup_irq+0x0/0x310) from [<c005fa54>] (setup_irq+0x28/0x2c)
> [<c005fa2c>] (setup_irq+0x0/0x2c) from [<c000c3a4>] (iop_init_time+0x58/0x108)
> r5:0bcd3d80 r4:c0312fa0
> [<c000c34c>] (iop_init_time+0x0/0x108) from [<c000bee4>] (n2100_timer_init+0x14/0x1c)
> r6:c001d9e4 r5:c001d9e8 r4:c0329d60
> [<c000bed0>] (n2100_timer_init+0x0/0x1c) from [<c0009f54>] (time_init+0x1c/0x24)
> [<c0009f38>] (time_init+0x0/0x24) from [<c0008a1c>] (start_kernel+0x170/0x264)
> [<c00088ac>] (start_kernel+0x0/0x264) from [<a0008034>] (0xa0008034)
> r5:c0329e64 r4:0000397d
>
> We take an early timer interrupt and call NULL in the
>
> evt->event_handler(evt);
>
> statement in iop_timer_interrupt(). Apparently the evt (dev_id) passed
> to the interrupt handler isn't initialized at this point.
evt is initialized, it's done statically:
static struct irqaction iop_timer_irq = {
.dev_id = &iop_clockevent,
};
What isn't initialized at this early point is evt->event_handler.
> The most visible change the sched_clock patches did in plat-iop was to add
> a call to init_sched_clock() at the very start of iop_init_time(), before
> the timer IRQ, clockevent, and clocksource have been set up. Moving that call
> to the very end of iop_init_time() [see below] made the kernel boot again,
> and the interactivity problems were also solved.
I think this is a bug just waiting to happen, and the sched_clock patch
just gives it a helping hand (by accidentally enabling interrupts early
- and that's something which also needs fixing.)
Here's the event device setup code:
write_tmr0(timer_ctl & ~IOP_TMR_EN);
setup_irq(IRQ_IOP_TIMER0, &iop_timer_irq);
clockevents_calc_mult_shift(&iop_clockevent,
tick_rate, IOP_MIN_RANGE);
iop_clockevent.max_delta_ns =
clockevent_delta2ns(0xfffffffe, &iop_clockevent);
iop_clockevent.min_delta_ns =
clockevent_delta2ns(0xf, &iop_clockevent);
iop_clockevent.cpumask = cpumask_of(0);
clockevents_register_device(&iop_clockevent);
write_trr0(ticks_per_jiffy - 1);
write_tcr0(ticks_per_jiffy - 1);
write_tmr0(timer_ctl);
First thing is that although the timer is stopped before the IRQ is
registered, there is no clearing of any pending timer interrupt at that
time. As we don't know what state the timer was in, we can't be sure
that the interrupt isn't already pending.
Second thing is why is the timer being enabled by this code after it's
been registered. This is something which should be done by the
clockevents code when it's ready via the ->set_mode callback, not when
the platform decides to do so - otherwise you can call the interrupt
handler when evt->event_handler has not been setup.
So, I think this will solve the IOP misbehaviour. What I don't know
is what the cryptic txx0() suffixes on these write statements are
(what's the difference between trr and tcr? tcr = timer counter
register, trr = timer ? register? Does trr need to be written in
->set_mode (if so that's another bug in this code)?
diff --git a/arch/arm/plat-iop/time.c b/arch/arm/plat-iop/time.c
index 0ca000d..e937e5d 100644
--- a/arch/arm/plat-iop/time.c
+++ b/arch/arm/plat-iop/time.c
@@ -162,6 +162,7 @@ void __init iop_init_time(unsigned long tick_rate)
* Set up interrupting clockevent timer 0.
*/
write_tmr0(timer_ctl & ~IOP_TMR_EN);
+ write_tisr(1);
setup_irq(IRQ_IOP_TIMER0, &iop_timer_irq);
clockevents_calc_mult_shift(&iop_clockevent,
tick_rate, IOP_MIN_RANGE);
@@ -171,9 +172,6 @@ void __init iop_init_time(unsigned long tick_rate)
clockevent_delta2ns(0xf, &iop_clockevent);
iop_clockevent.cpumask = cpumask_of(0);
clockevents_register_device(&iop_clockevent);
- write_trr0(ticks_per_jiffy - 1);
- write_tcr0(ticks_per_jiffy - 1);
- write_tmr0(timer_ctl);
/*
* Set up free-running clocksource timer 1.
^ permalink raw reply related [flat|nested] 77+ messages in thread* [PATCH 0/40] Complete set of clocksource/sched_clock patches
2010-12-19 12:55 ` Russell King - ARM Linux
@ 2010-12-19 14:05 ` Mikael Pettersson
2010-12-19 14:49 ` Russell King - ARM Linux
0 siblings, 1 reply; 77+ messages in thread
From: Mikael Pettersson @ 2010-12-19 14:05 UTC (permalink / raw)
To: linux-arm-kernel
Russell King - ARM Linux writes:
> > We take an early timer interrupt and call NULL in the
> >
> > evt->event_handler(evt);
> >
> > statement in iop_timer_interrupt(). Apparently the evt (dev_id) passed
> > to the interrupt handler isn't initialized at this point.
>
> evt is initialized, it's done statically:
>
> static struct irqaction iop_timer_irq = {
> .dev_id = &iop_clockevent,
> };
>
> What isn't initialized at this early point is evt->event_handler.
>
> > The most visible change the sched_clock patches did in plat-iop was to add
> > a call to init_sched_clock() at the very start of iop_init_time(), before
> > the timer IRQ, clockevent, and clocksource have been set up. Moving that call
> > to the very end of iop_init_time() [see below] made the kernel boot again,
> > and the interactivity problems were also solved.
>
> I think this is a bug just waiting to happen, and the sched_clock patch
> just gives it a helping hand (by accidentally enabling interrupts early
> - and that's something which also needs fixing.)
>
> Here's the event device setup code:
>
> write_tmr0(timer_ctl & ~IOP_TMR_EN);
> setup_irq(IRQ_IOP_TIMER0, &iop_timer_irq);
> clockevents_calc_mult_shift(&iop_clockevent,
> tick_rate, IOP_MIN_RANGE);
> iop_clockevent.max_delta_ns =
> clockevent_delta2ns(0xfffffffe, &iop_clockevent);
> iop_clockevent.min_delta_ns =
> clockevent_delta2ns(0xf, &iop_clockevent);
> iop_clockevent.cpumask = cpumask_of(0);
> clockevents_register_device(&iop_clockevent);
> write_trr0(ticks_per_jiffy - 1);
> write_tcr0(ticks_per_jiffy - 1);
> write_tmr0(timer_ctl);
>
> First thing is that although the timer is stopped before the IRQ is
> registered, there is no clearing of any pending timer interrupt at that
> time. As we don't know what state the timer was in, we can't be sure
> that the interrupt isn't already pending.
>
> Second thing is why is the timer being enabled by this code after it's
> been registered. This is something which should be done by the
> clockevents code when it's ready via the ->set_mode callback, not when
> the platform decides to do so - otherwise you can call the interrupt
> handler when evt->event_handler has not been setup.
When I did the IOP clockevents conversion I didn't know that the
timer should be disabled, so I probably just kept the previous code
to enable it.
> So, I think this will solve the IOP misbehaviour. What I don't know
> is what the cryptic txx0() suffixes on these write statements are
> (what's the difference between trr and tcr? tcr = timer counter
> register, trr = timer ? register?
tmr = timer mode register
tcr = timer counter register
trr = timer reload register
When a timer is in periodic mode it reloads itself from its reload
register when the counter register decrements to zero.
> Does trr need to be written in
> ->set_mode (if so that's another bug in this code)?
trr{0,1} need not and should not be changed after iop_time_init().
> diff --git a/arch/arm/plat-iop/time.c b/arch/arm/plat-iop/time.c
> index 0ca000d..e937e5d 100644
> --- a/arch/arm/plat-iop/time.c
> +++ b/arch/arm/plat-iop/time.c
> @@ -162,6 +162,7 @@ void __init iop_init_time(unsigned long tick_rate)
> * Set up interrupting clockevent timer 0.
> */
> write_tmr0(timer_ctl & ~IOP_TMR_EN);
> + write_tisr(1);
> setup_irq(IRQ_IOP_TIMER0, &iop_timer_irq);
> clockevents_calc_mult_shift(&iop_clockevent,
> tick_rate, IOP_MIN_RANGE);
> @@ -171,9 +172,6 @@ void __init iop_init_time(unsigned long tick_rate)
> clockevent_delta2ns(0xf, &iop_clockevent);
> iop_clockevent.cpumask = cpumask_of(0);
> clockevents_register_device(&iop_clockevent);
> - write_trr0(ticks_per_jiffy - 1);
> - write_tcr0(ticks_per_jiffy - 1);
> - write_tmr0(timer_ctl);
>
> /*
> * Set up free-running clocksource timer 1.
Yes, this seems correct. Tested in a vanilla kernel w/o sched_clock patches,
and in a kernel with the sched_clock patches it eliminated the boot hang.
^ permalink raw reply [flat|nested] 77+ messages in thread* [PATCH 0/40] Complete set of clocksource/sched_clock patches
2010-12-19 14:05 ` Mikael Pettersson
@ 2010-12-19 14:49 ` Russell King - ARM Linux
2010-12-19 16:15 ` Mikael Pettersson
0 siblings, 1 reply; 77+ messages in thread
From: Russell King - ARM Linux @ 2010-12-19 14:49 UTC (permalink / raw)
To: linux-arm-kernel
On Sun, Dec 19, 2010 at 03:05:56PM +0100, Mikael Pettersson wrote:
> tmr = timer mode register
> tcr = timer counter register
> trr = timer reload register
>
> When a timer is in periodic mode it reloads itself from its reload
> register when the counter register decrements to zero.
Ok.
> > Does trr need to be written in
> > ->set_mode (if so that's another bug in this code)?
>
> trr{0,1} need not and should not be changed after iop_time_init().
It sounds like trr0 needs to be written in ->set_mode's
CLOCK_EVT_MODE_PERIODIC path then, because with my patch, we never set
this register. Or will trr0 be updated when we write tcr0 ?
^ permalink raw reply [flat|nested] 77+ messages in thread* [PATCH 0/40] Complete set of clocksource/sched_clock patches
2010-12-19 14:49 ` Russell King - ARM Linux
@ 2010-12-19 16:15 ` Mikael Pettersson
0 siblings, 0 replies; 77+ messages in thread
From: Mikael Pettersson @ 2010-12-19 16:15 UTC (permalink / raw)
To: linux-arm-kernel
Russell King - ARM Linux writes:
> > > Does trr need to be written in
> > > ->set_mode (if so that's another bug in this code)?
> >
> > trr{0,1} need not and should not be changed after iop_time_init().
>
> It sounds like trr0 needs to be written in ->set_mode's
> CLOCK_EVT_MODE_PERIODIC path then, because with my patch, we never set
> this register.
Hmm, yes, your patch does cause that. I think it's better to keep the
write_trr0() in iop_init_time(), but move it ahead of the
clockevents_register_device() call; this avoids a needless reinitialization
of trr0 in ->set_mode's CLOCK_EVT_MODE_PERIODIC case. Writing to trr0 is safe,
it's only the early write to tmr0 that's dangerous.
My kernel survived that bug because I have CONFIG_NO_HZ=y so the clockevents
timer is always(?) reprogrammed into oneshot-mode, which doesn't use trr0.
> Or will trr0 be updated when we write tcr0 ?
No, only explicit write_trr0() calls can update trr0.
^ permalink raw reply [flat|nested] 77+ messages in thread
* [PATCH 0/40] Complete set of clocksource/sched_clock patches
2010-12-17 11:32 [PATCH 0/40] Complete set of clocksource/sched_clock patches Russell King - ARM Linux
` (42 preceding siblings ...)
2010-12-19 10:37 ` Mikael Pettersson
@ 2010-12-20 3:32 ` Eric Miao
2010-12-20 22:48 ` Russell King - ARM Linux
2010-12-21 19:24 ` Kevin Hilman
` (4 subsequent siblings)
48 siblings, 1 reply; 77+ messages in thread
From: Eric Miao @ 2010-12-20 3:32 UTC (permalink / raw)
To: linux-arm-kernel
On Fri, Dec 17, 2010 at 7:32 PM, Russell King - ARM Linux
<linux@arm.linux.org.uk> wrote:
> Here is the entire set of clocksource and sched_clock patches which
> have been previously posted. ?There's a couple of small tweaks in a
> few of the patches (such as adding notrace to OMAP clocksource read
> functions), and this also shows the proper ordering of these patches.
>
> Still looking for acks or tested-by's for these patches.
>
Hi Russell,
Sorry for late feedback. Tested the branch 'clksrc' on Littleton/PXA3xx,
seems to be good.
Tested-by: Eric Miao <eric.y.miao@gmail.com>
^ permalink raw reply [flat|nested] 77+ messages in thread* [PATCH 0/40] Complete set of clocksource/sched_clock patches
2010-12-20 3:32 ` Eric Miao
@ 2010-12-20 22:48 ` Russell King - ARM Linux
0 siblings, 0 replies; 77+ messages in thread
From: Russell King - ARM Linux @ 2010-12-20 22:48 UTC (permalink / raw)
To: linux-arm-kernel
On Mon, Dec 20, 2010 at 11:32:21AM +0800, Eric Miao wrote:
> On Fri, Dec 17, 2010 at 7:32 PM, Russell King - ARM Linux
> <linux@arm.linux.org.uk> wrote:
> > Here is the entire set of clocksource and sched_clock patches which
> > have been previously posted. ?There's a couple of small tweaks in a
> > few of the patches (such as adding notrace to OMAP clocksource read
> > functions), and this also shows the proper ordering of these patches.
> >
> > Still looking for acks or tested-by's for these patches.
> >
>
> Hi Russell,
>
> Sorry for late feedback. Tested the branch 'clksrc' on Littleton/PXA3xx,
> seems to be good.
>
> Tested-by: Eric Miao <eric.y.miao@gmail.com>
Ok, I'll add that to the PXA and generic patches, thanks.
^ permalink raw reply [flat|nested] 77+ messages in thread
* [PATCH 0/40] Complete set of clocksource/sched_clock patches
2010-12-17 11:32 [PATCH 0/40] Complete set of clocksource/sched_clock patches Russell King - ARM Linux
` (43 preceding siblings ...)
2010-12-20 3:32 ` Eric Miao
@ 2010-12-21 19:24 ` Kevin Hilman
2010-12-22 7:24 ` Olof Johansson
` (3 subsequent siblings)
48 siblings, 0 replies; 77+ messages in thread
From: Kevin Hilman @ 2010-12-21 19:24 UTC (permalink / raw)
To: linux-arm-kernel
Russell King - ARM Linux <linux@arm.linux.org.uk> writes:
> Here is the entire set of clocksource and sched_clock patches which
> have been previously posted. There's a couple of small tweaks in a
> few of the patches (such as adding notrace to OMAP clocksource read
> functions), and this also shows the proper ordering of these patches.
>
> Still looking for acks or tested-by's for these patches.
Tested-by: Kevin Hilman <khilman@deeprootsystems.com>
on a few davinci platforms.
Kevin
^ permalink raw reply [flat|nested] 77+ messages in thread* [PATCH 0/40] Complete set of clocksource/sched_clock patches
2010-12-17 11:32 [PATCH 0/40] Complete set of clocksource/sched_clock patches Russell King - ARM Linux
` (44 preceding siblings ...)
2010-12-21 19:24 ` Kevin Hilman
@ 2010-12-22 7:24 ` Olof Johansson
2010-12-22 10:59 ` Jamie Iles
` (2 subsequent siblings)
48 siblings, 0 replies; 77+ messages in thread
From: Olof Johansson @ 2010-12-22 7:24 UTC (permalink / raw)
To: linux-arm-kernel
On Fri, Dec 17, 2010 at 3:32 AM, Russell King - ARM Linux
<linux@arm.linux.org.uk> wrote:
> Here is the entire set of clocksource and sched_clock patches which
> have been previously posted. ?There's a couple of small tweaks in a
> few of the patches (such as adding notrace to OMAP clocksource read
> functions), and this also shows the proper ordering of these patches.
>
> Still looking for acks or tested-by's for these patches.
Tegra (see comment to that specific patch for a needed fixup):
Tested-by: Olof Johansson <olof@lixom.net>
^ permalink raw reply [flat|nested] 77+ messages in thread* [PATCH 0/40] Complete set of clocksource/sched_clock patches
2010-12-17 11:32 [PATCH 0/40] Complete set of clocksource/sched_clock patches Russell King - ARM Linux
` (45 preceding siblings ...)
2010-12-22 7:24 ` Olof Johansson
@ 2010-12-22 10:59 ` Jamie Iles
2010-12-22 21:59 ` JD (Jiandong) Zheng
2011-01-08 9:05 ` Wan ZongShun
48 siblings, 0 replies; 77+ messages in thread
From: Jamie Iles @ 2010-12-22 10:59 UTC (permalink / raw)
To: linux-arm-kernel
On Fri, Dec 17, 2010 at 11:32:23AM +0000, Russell King - ARM Linux wrote:
> Here is the entire set of clocksource and sched_clock patches which
> have been previously posted. There's a couple of small tweaks in a
> few of the patches (such as adding notrace to OMAP clocksource read
> functions), and this also shows the proper ordering of these patches.
>
> Still looking for acks or tested-by's for these patches.
Don't know if it helps, but I've tested the core patches on my picoxcell
series with the fixed versions and it works nicely.
Tested-by: Jamie Iles <jamie@jamieiles.com>
Jamie
^ permalink raw reply [flat|nested] 77+ messages in thread* [PATCH 0/40] Complete set of clocksource/sched_clock patches
2010-12-17 11:32 [PATCH 0/40] Complete set of clocksource/sched_clock patches Russell King - ARM Linux
` (46 preceding siblings ...)
2010-12-22 10:59 ` Jamie Iles
@ 2010-12-22 21:59 ` JD (Jiandong) Zheng
2011-01-08 9:05 ` Wan ZongShun
48 siblings, 0 replies; 77+ messages in thread
From: JD (Jiandong) Zheng @ 2010-12-22 21:59 UTC (permalink / raw)
To: linux-arm-kernel
Add my ack to [PATCH 02/40] ARM: bcmring: update clock source registration:
Acked-By: Jiandong Zheng <jdzheng@broadcom.com>
Thanks,
Jiandong Zheng
-----Original Message-----
From: Russell King - ARM Linux [mailto:linux at arm.linux.org.uk]
Sent: Friday, December 17, 2010 3:32 AM
To: Alessandro Rubini; Bryan Huntsman; Colin Cross; Daniel Walker; David Brown; Eric Miao; Erik Gilling; Hans J. Koch; Imre Kaloz; Kevin Hilman; Krzysztof Halasa; Kukjin Kim; Lennert Buytenhek; JD (Jiandong) Zheng; Linus Walleij; linux-arm-msm at vger.kernel.org; linux-omap at vger.kernel.org; linux-samsung-soc at vger.kernel.org; linux-tegra at vger.kernel.org; Nicolas Pitre; Olof Johansson; Sascha Hauer; Scott Branden; STEricsson; Tony Lindgren; Viresh Kumar; Wan ZongShun
Cc: linux-arm-kernel at lists.infradead.org
Subject: [PATCH 0/40] Complete set of clocksource/sched_clock patches
Here is the entire set of clocksource and sched_clock patches which
have been previously posted. There's a couple of small tweaks in a
few of the patches (such as adding notrace to OMAP clocksource read
functions), and this also shows the proper ordering of these patches.
Still looking for acks or tested-by's for these patches.
^ permalink raw reply [flat|nested] 77+ messages in thread* [PATCH 0/40] Complete set of clocksource/sched_clock patches
2010-12-17 11:32 [PATCH 0/40] Complete set of clocksource/sched_clock patches Russell King - ARM Linux
` (47 preceding siblings ...)
2010-12-22 21:59 ` JD (Jiandong) Zheng
@ 2011-01-08 9:05 ` Wan ZongShun
2011-01-08 9:23 ` Russell King - ARM Linux
48 siblings, 1 reply; 77+ messages in thread
From: Wan ZongShun @ 2011-01-08 9:05 UTC (permalink / raw)
To: linux-arm-kernel
2010/12/17 Russell King - ARM Linux <linux@arm.linux.org.uk>:
> Here is the entire set of clocksource and sched_clock patches which
> have been previously posted. ?There's a couple of small tweaks in a
> few of the patches (such as adding notrace to OMAP clocksource read
> functions), and this also shows the proper ordering of these patches.
>
> Still looking for acks or tested-by's for these patches.
>
Acked-By: Wan Zongshun <mcuos.com@gmail.com>
--
*linux-arm-kernel mailing list
mail addr:linux-arm-kernel at lists.infradead.org
you can subscribe by:
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
* linux-arm-NUC900 mailing list
mail addr:NUC900 at googlegroups.com
main web: https://groups.google.com/group/NUC900
you can subscribe it by sending me mail:
mcuos.com at gmail.com
^ permalink raw reply [flat|nested] 77+ messages in thread* [PATCH 0/40] Complete set of clocksource/sched_clock patches
2011-01-08 9:05 ` Wan ZongShun
@ 2011-01-08 9:23 ` Russell King - ARM Linux
0 siblings, 0 replies; 77+ messages in thread
From: Russell King - ARM Linux @ 2011-01-08 9:23 UTC (permalink / raw)
To: linux-arm-kernel
On Sat, Jan 08, 2011 at 05:05:53PM +0800, Wan ZongShun wrote:
> 2010/12/17 Russell King - ARM Linux <linux@arm.linux.org.uk>:
> > Here is the entire set of clocksource and sched_clock patches which
> > have been previously posted. ?There's a couple of small tweaks in a
> > few of the patches (such as adding notrace to OMAP clocksource read
> > functions), and this also shows the proper ordering of these patches.
> >
> > Still looking for acks or tested-by's for these patches.
> >
>
> Acked-By: Wan Zongshun <mcuos.com@gmail.com>
I'm afraid you're too late - it's already in mainline so your ack can't
be added.
^ permalink raw reply [flat|nested] 77+ messages in thread