summaryrefslogtreecommitdiffstats
path: root/arch/arm/kernel/sched_clock.c
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@arm.linux.org.uk>2011-01-11 17:23:04 +0100
committerRussell King <rmk+kernel@arm.linux.org.uk>2011-01-11 17:23:04 +0100
commit211baa7016894c02fc18693e21ca479cd08ac0c0 (patch)
tree0fea398c6288b46542fc1640adff697f9b1e07a5 /arch/arm/kernel/sched_clock.c
parentARM: integrator: fix compile warning in cpu.c (diff)
downloadlinux-211baa7016894c02fc18693e21ca479cd08ac0c0.tar.xz
linux-211baa7016894c02fc18693e21ca479cd08ac0c0.zip
ARM: sched_clock: allow init_sched_clock() to be called early
sched_clock is supposed to be initialized early - in the recently added init_early platform hook. However, in doing so we end up calling mod_timer() before the timer lists are initialized, resulting in an oops. Split the initialization in two - the part which the platform calls early which starts things off. The addition of the timer can be delayed until after we have more of the kernel initialized - when the normal time sources are initialized. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/kernel/sched_clock.c')
-rw-r--r--arch/arm/kernel/sched_clock.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/arch/arm/kernel/sched_clock.c b/arch/arm/kernel/sched_clock.c
index 2cdcc9287c74..784464a21c1c 100644
--- a/arch/arm/kernel/sched_clock.c
+++ b/arch/arm/kernel/sched_clock.c
@@ -60,10 +60,15 @@ void __init init_sched_clock(struct clock_data *cd, void (*update)(void),
* sets the initial epoch.
*/
sched_clock_timer.data = msecs_to_jiffies(w - (w / 10));
- sched_clock_poll(sched_clock_timer.data);
+ update();
/*
* Ensure that sched_clock() starts off at 0ns
*/
cd->epoch_ns = 0;
}
+
+void __init sched_clock_postinit(void)
+{
+ sched_clock_poll(sched_clock_timer.data);
+}