Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[PATCH] time initialisation fix

We're not reay to take a timer interrupt until timekeeping_init() has run.
But time_init() will start the time interrupt and if it is called with
local interrupts enabled we'll immediately take an interrupt and die.

Fix that by running timekeeping_init() prior to time_init().

We don't know _why_ local interrupts got enabled on Jesse Brandeburg's
machine. That's a separate as-yet-unsolved problem. THe patch adds a little
bit of debugging to detect that.

This whole requirement that local interrupts be held off during early boot
keeps on biting us.

Signed-off-by: John Stultz <johnstul@us.ibm.com>
Cc: Jesse Brandeburg <jesse.brandeburg@gmail.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

authored by

john stultz and committed by
Linus Torvalds
88fecaa2 29454dde

+3 -1
+3 -1
init/main.c
··· 496 496 init_timers(); 497 497 hrtimers_init(); 498 498 softirq_init(); 499 - time_init(); 500 499 timekeeping_init(); 500 + time_init(); 501 501 502 502 /* 503 503 * HACK ALERT! This is early. We're enabling the console before ··· 508 508 if (panic_later) 509 509 panic(panic_later, panic_param); 510 510 profile_init(); 511 + if (!irqs_disabled()) 512 + printk("start_kernel(): bug: interrupts were enabled early\n"); 511 513 local_irq_enable(); 512 514 #ifdef CONFIG_BLK_DEV_INITRD 513 515 if (initrd_start && !initrd_below_start_ok &&