From: Robin Getz <rgetz@blackfin.uclinux.org>
To: "Mike Frysinger" <vapier.adi@gmail.com>
Cc: "Andrew Morton" <akpm@linux-foundation.org>,
torvalds@linux-foundation.org, linux-kernel@vger.kernel.org,
"Gerd Hoffmann" <kraxel@redhat.com>,
"Mike Frysinger" <vapier.adi@gmail.com>
Subject: Re: [PATCH 1/1] ensure we don't use bootconsoles after init has been released
Date: Mon, 20 Aug 2007 00:08:45 -0400 [thread overview]
Message-ID: <200708200008.45327.rgetz@blackfin.uclinux.org> (raw)
In-Reply-To: <8bd0f97a0708192011m1b957e57je313850a255dcac7@mail.gmail.com>
From: Robin Getz <rgetz@blackfin.uclinux.org>
This is a followup to the cleanups for earlyprintk patch from Gerd Hoffmann
http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=69331af79cf29e26d1231152a172a1a10c2df511
This ensures that a bootconsole is unregistered if it is not replaced.
The current implementation spews garbage out the bootconsole in this case,
since the bootconsole structure is normally in the init section, and is
freed, but still used.
Signed-off-by: Robin Getz <rgetz@blackfin.uclinux.org>
---
linux-2.6.x-old/kernel/printk.c | 15 +++++++++++++++
1 file changed, 15 insertions(+)
Index: linux-2.6.x-old/kernel/printk.c
===================================================================
--- linux-2.6.x-old/kernel/printk.c (revision 3583)
+++ linux-2.6.x-old/kernel/printk.c (working copy)
@@ -1104,6 +1104,21 @@
}
EXPORT_SYMBOL(unregister_console);
+static int __init disable_boot_consoles(void)
+{
+ struct console *con;
+
+ for (con = console_drivers; con; con = con->next) {
+ if (con->flags & CON_BOOT) {
+ printk(KERN_INFO "Turn off boot console %s%d\n",
+ con->name, con->index);
+ unregister_console(con);
+ }
+ }
+ return 0;
+}
+late_initcall(disable_boot_consoles);
+
/**
* tty_write_message - write a message to a certain tty, not just the console.
* @tty: the destination tty_struct
next prev parent reply other threads:[~2007-08-20 4:08 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-08-20 2:46 Robin Getz
2007-08-20 3:11 ` Mike Frysinger
2007-08-20 3:31 ` Paul Mundt
2007-08-20 17:14 ` Robin Getz
2007-08-20 19:07 ` Gerd Hoffmann
2007-08-20 19:22 ` Robin Getz
2007-08-20 19:26 ` Gerd Hoffmann
2007-08-20 22:47 ` Paul Mundt
2007-08-20 4:08 ` Robin Getz [this message]
2007-08-22 3:14 ` [PATCH 1/1] fix - " Robin Getz
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=200708200008.45327.rgetz@blackfin.uclinux.org \
--to=rgetz@blackfin.uclinux.org \
--cc=akpm@linux-foundation.org \
--cc=kraxel@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@linux-foundation.org \
--cc=vapier.adi@gmail.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
all inboxes | Powered by JetHome®