* [PATCH 0/24] Update clocksource registration
@ 2010-12-13 19:14 Russell King - ARM Linux
2010-12-13 19:19 ` [PATCH 13/24] ARM: s5pv310: 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)
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-kernel, linux-arm-msm, linux-omap,
linux-samsung-soc, Nicolas Pitre, Sascha Hauer, Scott Branden,
STEricsson, Tony Lindgren, Viresh Kumar,
Wan ZongShun <mcuo>
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 13/24] ARM: s5pv310: update clock source registration
2010-12-13 19:14 [PATCH 0/24] Update clocksource registration Russell King - ARM Linux
@ 2010-12-13 19:19 ` Russell King - ARM Linux
2010-12-17 4:49 ` Kukjin Kim
0 siblings, 1 reply; 3+ messages in thread
From: Russell King - ARM Linux @ 2010-12-13 19:19 UTC (permalink / raw)
To: linux-arm-kernel; +Cc: Kukjin Kim, linux-samsung-soc
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-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] 3+ messages in thread
* RE: [PATCH 13/24] ARM: s5pv310: update clock source registration
2010-12-13 19:19 ` [PATCH 13/24] ARM: s5pv310: update clock source registration Russell King - ARM Linux
@ 2010-12-17 4:49 ` Kukjin Kim
0 siblings, 0 replies; 3+ messages in thread
From: Kukjin Kim @ 2010-12-17 4:49 UTC (permalink / raw)
To: 'Russell King - ARM Linux', linux-arm-kernel; +Cc: linux-samsung-soc
Russell King 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.
>
> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Acked-by: Kukjin Kim <kgene.kim@samsung.com>
> ---
> 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);
> }
>
> --
Thanks.
Best regards,
Kgene.
--
Kukjin Kim <kgene.kim@samsung.com>, Senior Engineer,
SW Solution Development Team, Samsung Electronics Co., Ltd.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2010-12-17 4:49 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:19 ` [PATCH 13/24] ARM: s5pv310: update clock source registration Russell King - ARM Linux
2010-12-17 4:49 ` Kukjin Kim
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox