Title: [7166] branches/2009R1/kernel/printk.c: Bug[#5420] Restore Robin's patch.
- Revision
- 7166
- Author
- sonicz
- Date
- 2009-08-12 18:41:06 -0400 (Wed, 12 Aug 2009)
Log Message
Bug[#5420] Restore Robin's patch.
Double line kernel boot information is expected behavior if earlyprintk
is enabled from LKML's point of view.
Modified Paths
Diff
Modified: branches/2009R1/kernel/printk.c (7165 => 7166)
--- branches/2009R1/kernel/printk.c 2009-08-12 21:06:07 UTC (rev 7165)
+++ branches/2009R1/kernel/printk.c 2009-08-12 22:41:06 UTC (rev 7166)
@@ -1203,22 +1203,6 @@
if (!(newcon->flags & CON_ENABLED))
return;
- if (bcon && ((newcon->flags & (CON_CONSDEV | CON_BOOT)) == CON_CONSDEV)) {
- /* we need to iterate through twice, to make sure we print
- * everything out, before we unregister the console(s)
- */
- printk(KERN_INFO "console handover:");
- for_each_console(bcon)
- printk("boot [%s%d] ", bcon->name, bcon->index);
- printk(" -> real [%s%d]\n", newcon->name, newcon->index);
- for_each_console(bcon)
- unregister_console(bcon);
- } else {
- printk(KERN_INFO "%sconsole [%s%d] enabled\n",
- (newcon->flags & CON_BOOT) ? "boot" : "" ,
- newcon->name, newcon->index);
- }
-
/*
* Put this console in the list - keep the
* preferred driver at the head of the list.
@@ -1243,6 +1227,30 @@
spin_unlock_irqrestore(&logbuf_lock, flags);
}
release_console_sem();
+
+ /*
+ * By unregistering the bootconsoles after we enable the real console
+ * we get the "console xxx enabled" message on all the consoles -
+ * boot consoles, real consoles, etc - this is to ensure that end
+ * users know there might be something in the kernel's log buffer that
+ * went to the bootconsole (that they do not see on the real console)
+ */
+ if (bcon && ((newcon->flags & (CON_CONSDEV | CON_BOOT)) == CON_CONSDEV)) {
+ /* we need to iterate through twice, to make sure we print
+ * everything out, before we unregister the console(s)
+ */
+ printk(KERN_INFO "console [%s%d] enabled, bootconsole disabled\n",
+ newcon->name, newcon->index);
+ for_each_console(bcon)
+ if (bcon->flags & CON_BOOT)
+ unregister_console(bcon);
+ newcon->flags &= ~CON_PRINTBUFFER;
+ } else {
+ printk(KERN_INFO "%sconsole [%s%d] enabled\n",
+ (newcon->flags & CON_BOOT) ? "boot" : "" ,
+ newcon->name, newcon->index);
+ }
+
}
EXPORT_SYMBOL(register_console);
_______________________________________________
Linux-kernel-commits mailing list
[email protected]
https://blackfin.uclinux.org/mailman/listinfo/linux-kernel-commits