From: john stultz Delay installing new clocksources until later in boot. This avoids some of the clocksource churn that can occur at boot, possibly allowing the system to run for a brief time with a bad clocksource. This patch resolves the boot time stalls seen by Mattia Dongili. Signed-off-by: John Stultz Signed-off-by: Andrew Morton --- kernel/time/clocksource.c | 15 ++++++++++++++- 1 files changed, 14 insertions(+), 1 deletion(-) diff -puN kernel/time/clocksource.c~time-delay-clocksource-selection-until-later-in-boot kernel/time/clocksource.c --- devel/kernel/time/clocksource.c~time-delay-clocksource-selection-until-later-in-boot 2006-01-31 20:14:32.000000000 -0800 +++ devel-akpm/kernel/time/clocksource.c 2006-01-31 20:15:06.000000000 -0800 @@ -50,6 +50,19 @@ static struct clocksource *next_clocksou static LIST_HEAD(clocksource_list); static DEFINE_SPINLOCK(clocksource_lock); static char override_name[32]; +static int finished_booting; + +/* clocksource_done_booting - Called near the end of bootup + * + * Hack to avoid lots of clocksource churn at boot time + */ +static int clocksource_done_booting(void) +{ + finished_booting = 1; + return 0; +} + +late_initcall(clocksource_done_booting); /** * get_next_clocksource - Returns the selected clocksource @@ -59,7 +72,7 @@ struct clocksource *get_next_clocksource unsigned long flags; spin_lock_irqsave(&clocksource_lock, flags); - if (next_clocksource) { + if (next_clocksource && finished_booting) { curr_clocksource = next_clocksource; next_clocksource = NULL; } _