The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: "Jan Beulich" <jbeulich@novell.com>
To: "Andi Kleen" <ak@suse.de>
Cc: <linux-kernel@vger.kernel.org>, <discuss@x86-64.org>
Subject: [PATCH] use CON_BOOT in early printk code
Date: Wed, 15 Nov 2006 15:01:19 +0000	[thread overview]
Message-ID: <455B39CF.76E4.0078.0@novell.com> (raw)

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");
-	}
 }
 



                 reply	other threads:[~2006-11-15 15:00 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=455B39CF.76E4.0078.0@novell.com \
    --to=jbeulich@novell.com \
    --cc=ak@suse.de \
    --cc=discuss@x86-64.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox