Skip to content

Commit

Permalink
[PATCH] powerpc: Add udbg-immortal kernel option
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Benjamin Herrenschmidt authored and Paul Mackerras committed Jun 9, 2006
1 parent e78dbc8 commit 3b5e905
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions arch/powerpc/kernel/udbg.c
Original file line number Diff line number Diff line change
Expand Up @@ -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>

Expand Down Expand Up @@ -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 */
Expand Down

0 comments on commit 3b5e905

Please sign in to comment.