From: Jeremy Fitzhardinge <jeremy@goop.org>
To: Andi Kleen <ak@muc.de>
Cc: Zachary Amsden <zach@vmware.com>,
xen-devel@lists.xensource.com,
Rusty Russell <rusty@rustcorp.com.au>,
linux-kernel@vger.kernel.org, Chris Wright <chrisw@sous-sol.org>,
virtualization@lists.osdl.org,
Andrew Morton <akpm@linux-foundation.org>
Subject: [patch 18/24] Xen-paravirt_ops: Some generic early printk & boot console fixups
Date: Wed, 21 Feb 2007 12:53:12 -0800 [thread overview]
Message-ID: <20070221205323.842917348@goop.org> (raw)
In-Reply-To: 20070221205254.169835700@goop.org
[-- Attachment #1: early-printk-boot-console.patch --]
[-- Type: text/plain, Size: 3705 bytes --]
Some generic early printk & boot console fixups
(already sent to lkml).
From: Gerd Hoffmann <kraxel@suse.de>
Signed-off-by: Jeremy Fitzhardinge <jeremy@xensource.com>
---
arch/x86_64/kernel/early_printk.c | 20 +++++---------------
drivers/char/tty_io.c | 5 -----
kernel/printk.c | 26 ++++++++++++++++----------
3 files changed, 21 insertions(+), 30 deletions(-)
===================================================================
--- paravirt-2.6.20-hg770.orig/arch/x86_64/kernel/early_printk.c
+++ paravirt-2.6.20-hg770/arch/x86_64/kernel/early_printk.c
@@ -244,22 +244,12 @@ static int __init setup_early_printk(cha
early_console = &simnow_console;
keep_early = 1;
}
+
+ if (keep_early)
+ early_console->flags &= ~CON_BOOT;
+ else
+ early_console->flags |= CON_BOOT;
register_console(early_console);
return 0;
}
-
early_param("earlyprintk", setup_early_printk);
-
-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");
- }
-}
-
===================================================================
--- paravirt-2.6.20-hg770.orig/kernel/printk.c
+++ paravirt-2.6.20-hg770/kernel/printk.c
@@ -931,8 +931,16 @@ void register_console(struct console *co
{
int i;
unsigned long flags;
+ struct console *bootconsole = NULL;
- if (preferred_console < 0)
+ if (console_drivers) {
+ if (console->flags & CON_BOOT)
+ return;
+ if (console_drivers->flags & CON_BOOT)
+ bootconsole = console_drivers;
+ }
+
+ if (preferred_console < 0 || bootconsole || !console_drivers)
preferred_console = selected_console;
/*
@@ -978,8 +986,11 @@ void register_console(struct console *co
if (!(console->flags & CON_ENABLED))
return;
- if (console_drivers && (console_drivers->flags & CON_BOOT)) {
- unregister_console(console_drivers);
+ if (bootconsole) {
+ printk(KERN_INFO "console handover: boot [%s%d] -> real [%s%d]\n",
+ bootconsole->name, bootconsole->index,
+ console->name, console->index);
+ unregister_console(bootconsole);
console->flags &= ~CON_PRINTBUFFER;
}
@@ -1030,16 +1041,11 @@ int unregister_console(struct console *c
}
}
- /* If last console is removed, we re-enable picking the first
- * one that gets registered. Without that, pmac early boot console
- * would prevent fbcon from taking over.
- *
+ /*
* If this isn't the last console and it has CON_CONSDEV set, we
* need to set it on the next preferred console.
*/
- if (console_drivers == NULL)
- preferred_console = selected_console;
- else if (console->flags & CON_CONSDEV)
+ if (console_drivers != NULL && console->flags & CON_CONSDEV)
console_drivers->flags |= CON_CONSDEV;
release_console_sem();
===================================================================
--- paravirt-2.6.20-hg770.orig/drivers/char/tty_io.c
+++ paravirt-2.6.20-hg770/drivers/char/tty_io.c
@@ -141,8 +141,6 @@ static DECLARE_MUTEX(allocated_ptys_lock
static int ptmx_open(struct inode *, struct file *);
#endif
-extern void disable_early_printk(void);
-
static void initialize_tty_struct(struct tty_struct *tty);
static ssize_t tty_read(struct file *, char __user *, size_t, loff_t *);
@@ -3881,9 +3879,6 @@ void __init console_init(void)
* set up the console device so that later boot sequences can
* inform about problems etc..
*/
-#ifdef CONFIG_EARLY_PRINTK
- disable_early_printk();
-#endif
call = __con_initcall_start;
while (call < __con_initcall_end) {
(*call)();
--
next prev parent reply other threads:[~2007-02-21 20:53 UTC|newest]
Thread overview: 37+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-02-21 20:52 [patch 00/24] Xen-paravirt_ops: Xen guest implementation for paravirt_ops interface Jeremy Fitzhardinge
2007-02-21 20:52 ` [patch 01/24] Xen-paravirt_ops: No need to use -traditional for processing asm in arch/i386/ Jeremy Fitzhardinge
2007-02-21 20:52 ` [patch 02/24] Xen-paravirt_ops: Clean up ELF note generation Jeremy Fitzhardinge
2007-02-21 20:52 ` [patch 03/24] Xen-paravirt_ops: Fix typo in sync_constant_test_bit()s name Jeremy Fitzhardinge
2007-02-21 20:52 ` [patch 04/24] Xen-paravirt_ops: ignore vgacon if hardware not present Jeremy Fitzhardinge
2007-02-21 20:52 ` [patch 05/24] Xen-paravirt_ops: Add pagetable accessors to pack and unpack pagetable entries Jeremy Fitzhardinge
2007-02-21 22:15 ` Andi Kleen
2007-02-21 22:20 ` Jeremy Fitzhardinge
2007-02-21 23:20 ` Rusty Russell
2007-02-21 23:27 ` Jeremy Fitzhardinge
2007-02-21 20:53 ` [patch 06/24] Xen-paravirt_ops: paravirt_ops: hooks to set up initial pagetable Jeremy Fitzhardinge
2007-02-21 20:53 ` [patch 07/24] Xen-paravirt_ops: paravirt_ops: allocate a fixmap slot Jeremy Fitzhardinge
2007-02-21 20:53 ` [patch 08/24] Xen-paravirt_ops: Allow paravirt backend to choose kernel PMD sharing Jeremy Fitzhardinge
2007-02-21 20:53 ` [patch 09/24] Xen-paravirt_ops: add hooks to intercept mm creation and destruction Jeremy Fitzhardinge
2007-02-21 20:53 ` [patch 10/24] Xen-paravirt_ops: remove HAVE_ARCH_MM_LIFETIME, define no-op architecture implementations Jeremy Fitzhardinge
2007-02-21 20:53 ` [patch 11/24] Xen-paravirt_ops: Add apply_to_page_range() which applies a function to a pte range Jeremy Fitzhardinge
2007-02-21 20:53 ` [patch 12/24] Xen-paravirt_ops: Allocate and free vmalloc areas Jeremy Fitzhardinge
2007-02-21 20:53 ` [patch 13/24] Xen-paravirt_ops: Add nosegneg capability to the vsyscall page notes Jeremy Fitzhardinge
2007-02-21 20:53 ` [patch 14/24] Xen-paravirt_ops: Add XEN config options Jeremy Fitzhardinge
2007-02-21 20:53 ` [patch 15/24] Xen-paravirt_ops: Add Xen interface header files Jeremy Fitzhardinge
2007-02-21 20:53 ` [patch 16/24] Xen-paravirt_ops: Core Xen implementation Jeremy Fitzhardinge
2007-02-21 20:53 ` [patch 17/24] Xen-paravirt_ops: avoid having a bad selector in %gs during context switch Jeremy Fitzhardinge
2007-02-21 22:10 ` Andi Kleen
2007-02-21 22:14 ` Jeremy Fitzhardinge
2007-02-21 22:16 ` Keir Fraser
2007-02-21 23:25 ` Zachary Amsden
2007-02-21 23:29 ` Jeremy Fitzhardinge
2007-02-21 20:53 ` Jeremy Fitzhardinge [this message]
2007-02-22 3:10 ` [patch 18/24] Xen-paravirt_ops: Some generic early printk & boot console fixups Andrew Morton
2007-02-22 5:48 ` Jeremy Fitzhardinge
2007-02-22 8:33 ` Gerd Hoffmann
2007-02-21 20:53 ` [patch 19/24] Xen-paravirt_ops: Use the hvc console infrastructure for Xen console Jeremy Fitzhardinge
2007-02-21 20:53 ` [patch 20/24] Xen-paravirt_ops: Add early printk support via hvc console Jeremy Fitzhardinge
2007-02-21 20:53 ` [patch 21/24] Xen-paravirt_ops: Add Xen grant table support Jeremy Fitzhardinge
2007-02-21 20:53 ` [patch 22/24] Xen-paravirt_ops: Add the Xenbus sysfs and virtual device hotplug driver Jeremy Fitzhardinge
2007-02-21 20:53 ` [patch 23/24] Xen-paravirt_ops: Add Xen virtual block device driver Jeremy Fitzhardinge
2007-02-21 20:53 ` [patch 24/24] Xen-paravirt_ops: Add the Xen virtual network " Jeremy Fitzhardinge
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=20070221205323.842917348@goop.org \
--to=jeremy@goop.org \
--cc=ak@muc.de \
--cc=akpm@linux-foundation.org \
--cc=chrisw@sous-sol.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rusty@rustcorp.com.au \
--cc=virtualization@lists.osdl.org \
--cc=xen-devel@lists.xensource.com \
--cc=zach@vmware.com \
/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;
as well as URLs for NNTP newsgroup(s).