Skip to content

Commit

Permalink
[PATCH] start_kernel: test if irq's got enabled early, barf, and disa…
Browse files Browse the repository at this point in the history
…ble them again

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: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
Ard van Breemen authored and Linus Torvalds committed Jan 6, 2007
1 parent 34f1ca5 commit c4a6830
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions init/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -538,6 +538,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();
Expand Down

0 comments on commit c4a6830

Please sign in to comment.