]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
start_kernel: test if irq's got enabled early, barf, and disable them again
authorArd van Breemen <ard@telegraafnet.nl>
Fri, 20 Apr 2007 22:10:28 +0000 (00:10 +0200)
committerAdrian Bunk <bunk@stusta.de>
Fri, 20 Apr 2007 22:10:28 +0000 (00:10 +0200)
The calls made by parse_parms to other initialization code might enable
interrupts again way too early.

Having interrupts on this early can make systems PANIC when they initialize
the IRQ controllers (which happens later in the code).  This patch detects
that irq's are enabled again, barfs about it and disables them again as a
safety net.

[akpm@osdl.org: cleanups]
Signed-off-by: Ard van Breemen <ard@telegraafnet.nl>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
init/main.c

index 4c194c47395f9b7c06fc4dd713d920eadcd2f757..5edd3013d810896519679acc6abb759307ccda45 100644 (file)
@@ -477,6 +477,11 @@ asmlinkage void __init start_kernel(void)
        parse_args("Booting kernel", command_line, __start___param,
                   __stop___param - __start___param,
                   &unknown_bootoption);
+       if (!irqs_disabled()) {
+               printk(KERN_WARNING "start_kernel(): bug: interrupts were "
+                               "enabled *very* early, fixing it\n");
+               local_irq_disable();
+       }
        sort_main_extable();
        trap_init();
        rcu_init();