diff options
author | Russell King <rmk+kernel@arm.linux.org.uk> | 2011-01-06 17:33:32 -0500 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2011-01-06 17:33:32 -0500 |
commit | 404a02cbd2ae8bf256a2fa1169bdfe86bb5ebb34 (patch) | |
tree | 99119edc53fdca73ed7586829b8ee736e09440b3 /arch/arm/mach-davinci/time.c | |
parent | 28cdac6690cb113856293bf79b40de33dbd8f974 (diff) | |
parent | 1051b9f0f9eab8091fe3bf98320741adf36b4cfa (diff) |
Merge branch 'devel-stable' into devel
Conflicts:
arch/arm/mach-pxa/clock.c
arch/arm/mach-pxa/clock.h
Diffstat (limited to 'arch/arm/mach-davinci/time.c')
-rw-r--r-- | arch/arm/mach-davinci/time.c | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/arch/arm/mach-davinci/time.c b/arch/arm/mach-davinci/time.c index c1486716de77..e1969ce904dc 100644 --- a/arch/arm/mach-davinci/time.c +++ b/arch/arm/mach-davinci/time.c | |||
@@ -272,14 +272,35 @@ static cycle_t read_cycles(struct clocksource *cs) | |||
272 | return (cycles_t)timer32_read(t); | 272 | return (cycles_t)timer32_read(t); |
273 | } | 273 | } |
274 | 274 | ||
275 | /* | ||
276 | * Kernel assumes that sched_clock can be called early but may not have | ||
277 | * things ready yet. | ||
278 | */ | ||
279 | static cycle_t read_dummy(struct clocksource *cs) | ||
280 | { | ||
281 | return 0; | ||
282 | } | ||
283 | |||
284 | |||
275 | static struct clocksource clocksource_davinci = { | 285 | static struct clocksource clocksource_davinci = { |
276 | .rating = 300, | 286 | .rating = 300, |
277 | .read = read_cycles, | 287 | .read = read_dummy, |
278 | .mask = CLOCKSOURCE_MASK(32), | 288 | .mask = CLOCKSOURCE_MASK(32), |
279 | .flags = CLOCK_SOURCE_IS_CONTINUOUS, | 289 | .flags = CLOCK_SOURCE_IS_CONTINUOUS, |
280 | }; | 290 | }; |
281 | 291 | ||
282 | /* | 292 | /* |
293 | * Overwrite weak default sched_clock with something more precise | ||
294 | */ | ||
295 | unsigned long long notrace sched_clock(void) | ||
296 | { | ||
297 | const cycle_t cyc = clocksource_davinci.read(&clocksource_davinci); | ||
298 | |||
299 | return clocksource_cyc2ns(cyc, clocksource_davinci.mult, | ||
300 | clocksource_davinci.shift); | ||
301 | } | ||
302 | |||
303 | /* | ||
283 | * clockevent | 304 | * clockevent |
284 | */ | 305 | */ |
285 | static int davinci_set_next_event(unsigned long cycles, | 306 | static int davinci_set_next_event(unsigned long cycles, |
@@ -376,6 +397,7 @@ static void __init davinci_timer_init(void) | |||
376 | davinci_clock_tick_rate = clk_get_rate(timer_clk); | 397 | davinci_clock_tick_rate = clk_get_rate(timer_clk); |
377 | 398 | ||
378 | /* setup clocksource */ | 399 | /* setup clocksource */ |
400 | clocksource_davinci.read = read_cycles; | ||
379 | clocksource_davinci.name = id_to_name[clocksource_id]; | 401 | clocksource_davinci.name = id_to_name[clocksource_id]; |
380 | if (clocksource_register_hz(&clocksource_davinci, | 402 | if (clocksource_register_hz(&clocksource_davinci, |
381 | davinci_clock_tick_rate)) | 403 | davinci_clock_tick_rate)) |