[PATCH] lockdep: better lock debugging
[deliverable/linux.git] / init / main.c
index ae04eb78a93a6f4db0017ee0e4cbdec0d764e7d7..fc73e1cd86147dc56762ba5ee1e936c34c60bba7 100644 (file)
@@ -11,7 +11,6 @@
 
 #define __KERNEL_SYSCALLS__
 
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/module.h>
 #include <linux/proc_fs.h>
@@ -48,6 +47,7 @@
 #include <linux/key.h>
 #include <linux/unwind.h>
 #include <linux/buffer_head.h>
+#include <linux/debug_locks.h>
 
 #include <asm/io.h>
 #include <asm/bugs.h>
@@ -497,8 +497,12 @@ asmlinkage void __init start_kernel(void)
        init_timers();
        hrtimers_init();
        softirq_init();
-       time_init();
        timekeeping_init();
+       time_init();
+       profile_init();
+       if (!irqs_disabled())
+               printk("start_kernel(): bug: interrupts were enabled early\n");
+       local_irq_enable();
 
        /*
         * HACK ALERT! This is early. We're enabling the console before
@@ -508,8 +512,13 @@ asmlinkage void __init start_kernel(void)
        console_init();
        if (panic_later)
                panic(panic_later, panic_param);
-       profile_init();
-       local_irq_enable();
+       /*
+        * Need to run this when irqs are enabled, because it wants
+        * to self-test [hard/soft]-irqs on/off lock inversion bugs
+        * too:
+        */
+       locking_selftest();
+
 #ifdef CONFIG_BLK_DEV_INITRD
        if (initrd_start && !initrd_below_start_ok &&
                        initrd_start < min_low_pfn << PAGE_SHIFT) {
This page took 0.027077 seconds and 5 git commands to generate.