The patch titled From: Jeremy Fitzhardinge <jeremy@xxxxxxxx> has been added to the -mm tree. Its filename is xen-paravirt_ops-some-generic-early-printk-boot-console-fixups.patch *** Remember to use Documentation/SubmitChecklist when testing your code *** See http://www.zip.com.au/~akpm/linux/patches/stuff/added-to-mm.txt to find out what to do about this ------------------------------------------------------ Subject: From: Jeremy Fitzhardinge <jeremy@xxxxxxxx> From: Gerd Hoffmann <kraxel@xxxxxxx> Some generic early printk & boot console fixups (already sent to lkml). Signed-off-by: Jeremy Fitzhardinge <jeremy@xxxxxxxxxxxxx> --- =================================================================== Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- 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(-) diff -puN arch/x86_64/kernel/early_printk.c~xen-paravirt_ops-some-generic-early-printk-boot-console-fixups arch/x86_64/kernel/early_printk.c --- a/arch/x86_64/kernel/early_printk.c~xen-paravirt_ops-some-generic-early-printk-boot-console-fixups +++ a/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"); - } -} - diff -puN drivers/char/tty_io.c~xen-paravirt_ops-some-generic-early-printk-boot-console-fixups drivers/char/tty_io.c --- a/drivers/char/tty_io.c~xen-paravirt_ops-some-generic-early-printk-boot-console-fixups +++ a/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 *); @@ -3879,9 +3877,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)(); diff -puN kernel/printk.c~xen-paravirt_ops-some-generic-early-printk-boot-console-fixups kernel/printk.c --- a/kernel/printk.c~xen-paravirt_ops-some-generic-early-printk-boot-console-fixups +++ a/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(); _ Patches currently in -mm which might be from jeremy@xxxxxxxx are xen-paravirt_ops-no-need-to-use-traditional-for-processing-asm-in-arch-i386.patch xen-paravirt_ops-clean-up-elf-note-generation.patch xen-paravirt_ops-fix-typo-in-sync_constant_test_bits-name.patch xen-paravirt_ops-ignore-vgacon-if-hardware-not-present.patch xen-paravirt_ops-add-pagetable-accessors-to-pack-and-unpack-pagetable-entries.patch xen-paravirt_ops-paravirt_ops-hooks-to-set-up-initial-pagetable.patch xen-paravirt_ops-paravirt_ops-allocate-a-fixmap-slot.patch xen-paravirt_ops-allow-paravirt-backend-to-choose-kernel-pmd-sharing.patch xen-paravirt_ops-add-hooks-to-intercept-mm-creation-and-destruction.patch xen-paravirt_ops-remove-have_arch_mm_lifetime-define-no-op-architecture-implementations.patch xen-paravirt_ops-add-apply_to_page_range-which-applies-a-function-to-a-pte-range.patch xen-paravirt_ops-allocate-and-free-vmalloc-areas.patch xen-paravirt_ops-add-nosegneg-capability-to-the-vsyscall-page-notes.patch xen-paravirt_ops-add-xen-config-options.patch xen-paravirt_ops-add-xen-interface-header-files.patch xen-paravirt_ops-core-xen-implementation.patch xen-paravirt_ops-some-generic-early-printk-boot-console-fixups.patch xen-paravirt_ops-use-the-hvc-console-infrastructure-for-xen-console.patch xen-paravirt_ops-add-early-printk-support-via-hvc-console.patch xen-paravirt_ops-add-xen-grant-table-support.patch xen-paravirt_ops-add-the-xenbus-sysfs-and-virtual-device-hotplug-driver.patch xen-paravirt_ops-add-xen-virtual-block-device-driver.patch xen-paravirt_ops-add-the-xen-virtual-network-device-driver.patch fixes-and-cleanups-for-earlyprintk-aka-boot-console.patch - To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html