Skip to contentSkip to conversation

powerpc: Add udbg-immortal kernel option

PATCH In review Benjamin Herrenschmidt 3 participants 4 messages Jun 7, 2006 PowerPC

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---
Paul: this is not 2.6.17 material

arch/powerpc/kernel/udbg.c +5 -2
Index: linux-work/arch/powerpc/kernel/udbg.c
===================================================================
@@ -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 */
#1 lore raw

arch/powerpc/kernel/udbg.c static int early_console_initialized; · line 150

Quoted 5 lines · Benjamin Herrenschmidt
arch/powerpc/kernel/udbg.c +4 -0
 		return;
+	if (strstr(saved_command_line, "udbg-immortal")) {
+		printk(KERN_INFO "early console immortal !\n");
+		return;
+	}

So it's YOU who add spaces before punctuation all over arch/powerpc! Please fix. ;-)

-Olof

#2 lore raw
Quoted 9 lines · Olof Johansson

arch/powerpc/kernel/udbg.c static int early_console_initialized; · line 150

Quoted 5 lines · Benjamin Herrenschmidt
arch/powerpc/kernel/udbg.c +4 -0
 		return;
+	if (strstr(saved_command_line, "udbg-immortal")) {
+		printk(KERN_INFO "early console immortal !\n");
+		return;
+	}

So it's YOU who add spaces before punctuation all over arch/powerpc! Please fix. ;-)

No way :) Besides, that's how it should be done in french :)

Ben.

#3 lore raw
Quoted 2 lines · Benjamin Herrenschmidt

No way :) Besides, that's how it should be done in french :) =20

So you mean, like this?

Index: linux-work/arch/powerpc/kernel/udbg.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
=2D-- linux-work.orig/arch/powerpc/kernel/udbg.c 2006-05-31 14:13:59.000000=
000 +1000
+++ linux-work/arch/powerpc/kernel/udbg.c 2006-05-31 14:48:07.000000000 +10=
00
@@ -141,12 +142,14 @@ static int early_console_initialized;
=20
void __init disable_early_printk(void)
{
=2D#if 1
if (!early_console_initialized)
return;
+ if (strstr(saved_command_line, "udbg-immortel")) {
+ printk(KERN_INFO "console t=F4t immortel !\n");
+ return;
+ }
unregister_console(&udbg_console); early_console_initialized =3D 0;
=2D#endif
}
=20
/* called by setup_system */