]> err.no Git - linux-2.6/commitdiff
[PATCH] powerpc: Add udbg-immortal kernel option
authorBenjamin Herrenschmidt <benh@au1.ibm.com>
Wed, 7 Jun 2006 02:06:20 +0000 (12:06 +1000)
committerPaul Mackerras <paulus@samba.org>
Fri, 9 Jun 2006 11:24:10 +0000 (21:24 +1000)
When debugging early kernel crashes that happen after console_init() and
before a proper console driver takes over, we often have to go hack into
udbg.c to prevent it from unregistering so we can "see" what is
happening. This patch adds a kernel command line option "udbg-immortal"
instead to avoid having to modify the kernel.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
arch/powerpc/kernel/udbg.c

index 3774e80094f5393bc86395fbd0632420a1992917..67d9fd9ae2b53092cc2bf7727f29060f4331f921 100644 (file)
@@ -14,6 +14,7 @@
 #include <linux/types.h>
 #include <linux/sched.h>
 #include <linux/console.h>
+#include <linux/init.h>
 #include <asm/processor.h>
 #include <asm/udbg.h>
 
@@ -141,12 +142,14 @@ static int early_console_initialized;
 
 void __init disable_early_printk(void)
 {
-#if 1
        if (!early_console_initialized)
                return;
+       if (strstr(saved_command_line, "udbg-immortal")) {
+               printk(KERN_INFO "early console immortal !\n");
+               return;
+       }
        unregister_console(&udbg_console);
        early_console_initialized = 0;
-#endif
 }
 
 /* called by setup_system */