linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Xianghua Xiao <xiaoxianghua@gmail.com>
To: linux-kernel@vger.kernel.org, linux-rt-users@vger.kernel.org,
	Thomas Gleixner <tglx@linutronix.de>
Subject: Re: PREEMPT_RT (2.6.33-rt17) disabled printk-to-console after  console_init
Date: Tue, 18 May 2010 14:28:39 -0500	[thread overview]
Message-ID: <AANLkTinClrTDoXH4NPP2-SgSYH24ZTnqsop88aocdg4R@mail.gmail.com> (raw)
In-Reply-To: <AANLkTimxLHngWamPvWt-htGoZ7Nub72rvJAnmGtw4Eqw@mail.gmail.com>

On Tue, May 18, 2010 at 8:13 AM, Xianghua Xiao <xiaoxianghua@gmail.com> wrote:
> I would like to have printk output to my ttyS0 console all the time,
> with 2.6.33-rt17, after kernel is booted up with all messages shown
> normally on the serial port until I login in, from this point on, all
> printk messages go to 'dmesg(log_buf)' fine, but I could never get
> them shown up on serial console anymore. I tried adjust
> /proc/sys/kernel/printk etc none helped.
>
> Switch PREEMPT_RT to PREEMPT_VOLUNTARY and reboot, now everything
> works, i.e. I can see printk on my console after I login.
>
> Look at the RT patch itself, I do find some changes to printk itself,
> however I'm unsure what is causing this(i.e printk not going to
> console after login).
>
> Thanks,
> Xianghua
>

Thomas,

I could not get dmesg output to console/serial and
klogd(/var/log/messages) anymore with 2.6.33-rt17 _after_ the kernel
boot is done(on non-RT kernel it works fine). I made below changes it
starts to work again, however I'm unsure how safe the change is.
Please advise.

During googling I found this: http://lkml.org/lkml/2008/1/24/390, fyi.

Thanks a lot!
Xianghua

diff --git a/kernel/printk.c b/kernel/printk.c
index 073d27f..48ef843 100644
--- a/kernel/printk.c
+++ b/kernel/printk.c
@@ -430,7 +430,6 @@ static void __call_console_drivers(unsigned start,
unsigned end)

 	for_each_console(con) {
 		if ((con->flags & CON_ENABLED) && con->write &&
-		    console_atomic_safe(con) &&
 		    (cpu_online(raw_smp_processor_id()) ||
 		     (con->flags & CON_ANYTIME))) {
 			set_printk_might_sleep(1);
@@ -1093,9 +1092,6 @@ void release_console_mutex(void)
 	 * printk from non-preemptible sections so this is for the emergency
 	 * case only.
 	 */
-#ifdef CONFIG_PREEMPT_RT
-	if (!in_atomic() && !irqs_disabled())
-#endif
 	if (wake_klogd)
 		wake_up_klogd();
 }

  reply	other threads:[~2010-05-18 19:28 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-18 13:13 PREEMPT_RT (2.6.33-rt17) disabled printk-to-console after console_init Xianghua Xiao
2010-05-18 19:28 ` Xianghua Xiao [this message]
2010-05-18 19:47   ` Thomas Gleixner
2010-05-18 20:49     ` Xianghua Xiao
2010-05-20  8:33     ` Nikita V. Youshchenko
2010-05-20  9:25       ` Sujit K M
2010-05-20  9:32         ` Sujit K M
2010-05-20  9:47           ` Thomas Gleixner
2010-05-20 10:23             ` Nikita V. Youshchenko
2010-05-20 10:52               ` Thomas Gleixner
2010-05-20 11:12                 ` Nikita V. Youshchenko
2010-05-20 11:23                   ` Thomas Gleixner
2010-05-20 11:40                     ` Nikita V. Youshchenko

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=AANLkTinClrTDoXH4NPP2-SgSYH24ZTnqsop88aocdg4R@mail.gmail.com \
    --to=xiaoxianghua@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rt-users@vger.kernel.org \
    --cc=tglx@linutronix.de \
    /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).