The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH] use CON_BOOT in early printk code
@ 2006-11-15 15:01 Jan Beulich
  0 siblings, 0 replies; only message in thread
From: Jan Beulich @ 2006-11-15 15:01 UTC (permalink / raw)
  To: Andi Kleen; +Cc: linux-kernel, discuss

Making the code simpler and closing the time window between disabling
the early console and getting the real one ready.

Once all architectures using CONFIG_EARLY_PRINTK have done so, the
dummy disable_early_printk() could then also be removed.

Signed-off-by: Jan Beulich <jbeulich@novell.com>

--- linux-2.6.19-rc5/arch/x86_64/kernel/early_printk.c	2006-11-08 09:21:47.000000000 +0100
+++ 2.6.19-rc5-x86-early-printk/arch/x86_64/kernel/early_printk.c	2006-11-06 09:10:16.000000000 +0100
@@ -56,7 +56,7 @@ static void early_vga_write(struct conso
 static struct console early_vga_console = {
 	.name =		"earlyvga",
 	.write =	early_vga_write,
-	.flags =	CON_PRINTBUFFER,
+	.flags =	CON_PRINTBUFFER | CON_BOOT,
 	.index =	-1,
 };
 
@@ -152,7 +152,7 @@ static __init void early_serial_init(cha
 static struct console early_serial_console = {
 	.name =		"earlyser",
 	.write =	early_serial_write,
-	.flags =	CON_PRINTBUFFER,
+	.flags =	CON_PRINTBUFFER | CON_BOOT,
 	.index =	-1,
 };
 
@@ -213,8 +213,6 @@ void early_printk(const char *fmt, ...)
 	va_end(ap);
 }
 
-static int __initdata keep_early;
-
 static int __init setup_early_printk(char *buf)
 {
 	if (!buf)
@@ -224,9 +222,6 @@ static int __init setup_early_printk(cha
 		return 0;
 	early_console_initialized = 1;
 
-	if (!strcmp(buf,"keep"))
-		keep_early = 1;
-
 	if (!strncmp(buf, "serial", 6)) {
 		early_serial_init(buf + 6);
 		early_console = &early_serial_console;
@@ -242,9 +237,14 @@ static int __init setup_early_printk(cha
  	} else if (!strncmp(buf, "simnow", 6)) {
  		simnow_init(buf + 6);
  		early_console = &simnow_console;
- 		keep_early = 1;
 	}
+	if (strstr(buf,"keep"))
+		early_console->flags &= ~CON_BOOT;
+
 	register_console(early_console);
+	if (!(early_console->flags & CON_BOOT))
+		printk("Will keep early console.\n");
+
 	return 0;
 }
 
@@ -252,14 +252,5 @@ early_param("earlyprintk", setup_early_p
 
 void __init disable_early_printk(void)
 {
-	if (!early_console_initialized || !early_console)
-		return;
-	if (!keep_early) {
-		printk("disabling early console\n");
-		unregister_console(early_console);
-		early_console_initialized = 0;
-	} else {
-		printk("keeping early console\n");
-	}
 }
 



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2006-11-15 15:00 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-11-15 15:01 [PATCH] use CON_BOOT in early printk code Jan Beulich

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox