提交 3b5e905e 编写于 作者: B Benjamin Herrenschmidt 提交者: Paul Mackerras

[PATCH] powerpc: Add udbg-immortal kernel option

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: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: NPaul Mackerras <paulus@samba.org>
上级 e78dbc80
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
#include <linux/types.h> #include <linux/types.h>
#include <linux/sched.h> #include <linux/sched.h>
#include <linux/console.h> #include <linux/console.h>
#include <linux/init.h>
#include <asm/processor.h> #include <asm/processor.h>
#include <asm/udbg.h> #include <asm/udbg.h>
...@@ -141,12 +142,14 @@ static int early_console_initialized; ...@@ -141,12 +142,14 @@ static int early_console_initialized;
void __init disable_early_printk(void) void __init disable_early_printk(void)
{ {
#if 1
if (!early_console_initialized) if (!early_console_initialized)
return; return;
if (strstr(saved_command_line, "udbg-immortal")) {
printk(KERN_INFO "early console immortal !\n");
return;
}
unregister_console(&udbg_console); unregister_console(&udbg_console);
early_console_initialized = 0; early_console_initialized = 0;
#endif
} }
/* called by setup_system */ /* called by setup_system */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册