* [PATCH 0/24] Update clocksource registration
@ 2010-12-13 19:14 Russell King - ARM Linux
2010-12-13 19:17 ` [PATCH 08/24] ARM: MSM: update clock source registration Russell King - ARM Linux
0 siblings, 1 reply; 3+ messages in thread
From: Russell King - ARM Linux @ 2010-12-13 19:14 UTC (permalink / raw)
To: linux-arm-kernel
Cc: Alessandro Rubini, Bryan Huntsman, Daniel Walker, David Brown,
Eric Miao, Hans J. Koch, Imre Kaloz, Kevin Hilman,
Krzysztof Halasa, Kukjin Kim, Lennert Buytenhek, Leo Chen,
Linus Walleij, linux-arm-msm, linux-omap, linux-samsung-soc,
Nicolas Pitre, Sascha Hauer, Scott Branden, STEricsson,
Tony Lindgren, Viresh Kumar, Wan ZongShun
John Stultz notes in his commit:
clocksource: Add clocksource_register_hz/khz interface
How to pick good mult/shift pairs has always been difficult to
describe to folks writing clocksource drivers, since it requires
careful tradeoffs in adjustment accuracy vs overflow limits.
Now, with the clocks_calc_mult_shift function, its much
easier. However, not many clocksources have converted to using that
function, and there is still the issue of the max interval length
assumption being made by each clocksource driver independently.
So this patch simplifies the registration process by having
clocksources be registered with a hz/khz value and the registration
function taking care of setting mult/shift.
This should take most of the confusion out of writing a clocksource
driver.
Additionally it also keeps the shift size tradeoff (more accuracy vs
longer possible nohz times) centralized so the timekeeping core can
keep track of the assumptions being made.
This patch series updates all ARM platforms clocksource registration
to use the new clocksource_register_hz()/clocksource_register_khz()
functions, simplifying the selection of the multiply/shift constants.
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH 08/24] ARM: MSM: update clock source registration
2010-12-13 19:14 [PATCH 0/24] Update clocksource registration Russell King - ARM Linux
@ 2010-12-13 19:17 ` Russell King - ARM Linux
2010-12-14 20:32 ` Jeff Ohlstein
0 siblings, 1 reply; 3+ messages in thread
From: Russell King - ARM Linux @ 2010-12-13 19:17 UTC (permalink / raw)
To: linux-arm-kernel
Cc: David Brown, Daniel Walker, Bryan Huntsman, linux-arm-msm
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-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] 3+ messages in thread
* Re: [PATCH 08/24] ARM: MSM: update clock source registration
2010-12-13 19:17 ` [PATCH 08/24] ARM: MSM: update clock source registration Russell King - ARM Linux
@ 2010-12-14 20:32 ` Jeff Ohlstein
0 siblings, 0 replies; 3+ messages in thread
From: Jeff Ohlstein @ 2010-12-14 20:32 UTC (permalink / raw)
To: Russell King - ARM Linux
Cc: linux-arm-kernel, David Brown, Daniel Walker, Bryan Huntsman,
linux-arm-msm
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>
--
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] 3+ messages in thread
end of thread, other threads:[~2010-12-14 20:32 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-12-13 19:14 [PATCH 0/24] Update clocksource registration Russell King - ARM Linux
2010-12-13 19:17 ` [PATCH 08/24] ARM: MSM: update clock source registration Russell King - ARM Linux
2010-12-14 20:32 ` Jeff Ohlstein
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox