summaryrefslogtreecommitdiff
path: root/init/main.c
diff options
context:
space:
mode:
authorArd van Breemen <ard@telegraafnet.nl>2007-01-11 10:21:52 -0500
committerChris Wright <chrisw@sous-sol.org>2007-02-05 08:31:41 -0800
commita9281060e889df67249949013c22858135068738 (patch)
tree0c3fdd3cf6672cf99626d7594f476e43478f0651 /init/main.c
parent3167f4ef8f28a9a94b6463a83488107b99387e4d (diff)
[PATCH] start_kernel: test if irq's got enabled early, barf, and disable 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> Signed-off-by: Chris Wright <chrisw@sous-sol.org>
Diffstat (limited to 'init/main.c')
-rw-r--r--init/main.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/init/main.c b/init/main.c
index 36f608a7cfba..b9f78438dfdd 100644
--- a/init/main.c
+++ b/init/main.c
@@ -525,6 +525,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();