lkml.org 
[lkml]   [2009]   [Jul]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
SubjectRe: [PATCH] - printk handling more than one CON_BOOT
Date
On Wed 1 Jul 2009 21:08, Robin Getz pondered:
> printk.c | 146 +++++++++++++++++++++++++++++++++--------------------
> 1 file changed, 92 insertions(+), 54 deletions(-)
>
> diff --git a/kernel/printk.c b/kernel/printk.c
> index b4d97b5..9acc262 100644
> --- a/kernel/printk.c
> +++ b/kernel/printk.c

[snip]

> static int __init disable_boot_consoles(void)
> {
> - if (console_drivers != NULL) {
> - if (console_drivers->flags & CON_BOOT) {
> + struct console *con;
> +
> + for_each_console(con) {
> + if (con->flags & CON_BOOT) {
> printk(KERN_INFO "turn off boot console %s%d\n",
> - console_drivers->name, console_drivers->index);
> - return unregister_console(console_drivers);
> + con->name, con->index);
> + return unregister_console(con);
> }
> }
> return 0;

This causes a bug that Sonic found.

The below patch fixes it, and should be applied to tip.

---

From: Sonic Zhang <Sonic.Zhang@analog.com>

Don't return when we find the first bootconsole - it can leave other
bootconsoles still installed, and they can be used and cause problems later
(if they are in the init section, and eventually released), and cause
problems. Make sure we remove all of them.

Signed-off-by: Sonic Zhang <Sonic.Zhang@analog.com>
Signed-off-by: Robin Getz <rgetz@analog.com>

---

diff --git a/kernel/printk.c b/kernel/printk.c
index e0daaf5..e10d193 100644
--- a/kernel/printk.c
+++ b/kernel/printk.c
@@ -1352,7 +1352,7 @@ static int __init disable_boot_consoles(void)
if (con->flags & CON_BOOT) {
printk(KERN_INFO "turn off boot console %s%d\n",
con->name, con->index);
- return unregister_console(con);
+ unregister_console(con);
}
}
return 0;


\
 
 \ /
  Last update: 2009-07-21 20:35    [W:0.103 / U:0.720 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site