diff options
author | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2009-08-14 09:47:21 -0400 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2009-08-15 04:55:46 -0400 |
commit | f1b82746c1e93daf24e1ab9bfbd39bcdb2e7018b (patch) | |
tree | 1403e3662dd3b32cb8b17218bfdd9a640061f654 /kernel/time/timekeeping.c | |
parent | 1be396794897f80bfc8774719ba60309a9e3d374 (diff) |
clocksource: Cleanup clocksource selection
If a non high-resolution clocksource is first set as override clock
and then registered it becomes active even if the system is in one-shot
mode. Move the override check from sysfs_override_clocksource to the
clocksource selection. That fixes the bug and simplifies the code. The
check in clocksource_register for double registration of the same
clocksource is removed without replacement.
To find the initial clocksource a new weak function in jiffies.c is
defined that returns the jiffies clocksource. The architecture code
can then override the weak function with a more suitable clocksource,
e.g. the TOD clock on s390.
[ tglx: Folded in a fix from John Stultz ]
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Acked-by: John Stultz <johnstul@us.ibm.com>
Cc: Daniel Walker <dwalker@fifo99.com>
LKML-Reference: <20090814134808.388024160@de.ibm.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'kernel/time/timekeeping.c')
-rw-r--r-- | kernel/time/timekeeping.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c index b5673016089f..325a9b63265a 100644 --- a/kernel/time/timekeeping.c +++ b/kernel/time/timekeeping.c | |||
@@ -269,7 +269,7 @@ static void change_clocksource(void) | |||
269 | 269 | ||
270 | new = clocksource_get_next(); | 270 | new = clocksource_get_next(); |
271 | 271 | ||
272 | if (clock == new) | 272 | if (!new || clock == new) |
273 | return; | 273 | return; |
274 | 274 | ||
275 | clocksource_forward_now(); | 275 | clocksource_forward_now(); |
@@ -446,7 +446,7 @@ void __init timekeeping_init(void) | |||
446 | 446 | ||
447 | ntp_init(); | 447 | ntp_init(); |
448 | 448 | ||
449 | clock = clocksource_get_next(); | 449 | clock = clocksource_default_clock(); |
450 | if (clock->enable) | 450 | if (clock->enable) |
451 | clock->enable(clock); | 451 | clock->enable(clock); |
452 | /* set mult_orig on enable */ | 452 | /* set mult_orig on enable */ |