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/jiffies.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/jiffies.c')
-rw-r--r-- | kernel/time/jiffies.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/kernel/time/jiffies.c b/kernel/time/jiffies.c index c3f6c30816e3..5404a8456909 100644 --- a/kernel/time/jiffies.c +++ b/kernel/time/jiffies.c | |||
@@ -61,7 +61,6 @@ struct clocksource clocksource_jiffies = { | |||
61 | .read = jiffies_read, | 61 | .read = jiffies_read, |
62 | .mask = 0xffffffff, /*32bits*/ | 62 | .mask = 0xffffffff, /*32bits*/ |
63 | .mult = NSEC_PER_JIFFY << JIFFIES_SHIFT, /* details above */ | 63 | .mult = NSEC_PER_JIFFY << JIFFIES_SHIFT, /* details above */ |
64 | .mult_orig = NSEC_PER_JIFFY << JIFFIES_SHIFT, | ||
65 | .shift = JIFFIES_SHIFT, | 64 | .shift = JIFFIES_SHIFT, |
66 | }; | 65 | }; |
67 | 66 | ||
@@ -71,3 +70,8 @@ static int __init init_jiffies_clocksource(void) | |||
71 | } | 70 | } |
72 | 71 | ||
73 | core_initcall(init_jiffies_clocksource); | 72 | core_initcall(init_jiffies_clocksource); |
73 | |||
74 | struct clocksource * __init __weak clocksource_default_clock(void) | ||
75 | { | ||
76 | return &clocksource_jiffies; | ||
77 | } | ||