public inbox for linux-rt-users@vger.kernel.org
 help / color / mirror / Atom feed
From: Venkat Subbiah <vsubbiah@caviumnetworks.com>
To: RT <linux-rt-users@vger.kernel.org>
Subject: patch to fix early printks with PREMPT_RT_FULL
Date: Fri, 04 May 2012 18:07:22 -0700	[thread overview]
Message-ID: <4FA47D4A.6020009@caviumnetworks.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 403 bytes --]

Hello,

With PREMPT_RT_FULL I notice couple of issues when early printk is turned on

1)  printks show up only after the full console is enabled
2)  There are double prints for each of the prinkts before the full 
console was enabled.

The attached patch seem to fix the issue, but I am not sure whether this 
is completely with
the lock being acquired in console_trylock_for_printk().

Thanks,
Venkat


[-- Attachment #2: 0001-printk-Allow-early-console-prints-with-PREEMPT_RT_FU.patch --]
[-- Type: text/x-patch, Size: 1465 bytes --]

>From 876c0653e4482357823d1d36858aed7b5cd8d1fa Mon Sep 17 00:00:00 2001
From: Venkat Subbiah <venkat.subbiah@cavium.com>
Date: Fri, 4 May 2012 17:53:16 -0700
Subject: [PATCH] printk: Allow early console prints with PREEMPT_RT_FULL

Signed-off-by: Venkat Subbiah <venkat.subbiah@cavium.com>
---
 kernel/printk.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/kernel/printk.c b/kernel/printk.c
index d3f22ec..d2dda2f 100644
--- a/kernel/printk.c
+++ b/kernel/printk.c
@@ -832,6 +832,8 @@ static inline int can_use_console(unsigned int cpu)
 	return cpu_online(cpu) || have_callable_console();
 }
 
+static int boot_console_active = 1;
+
 /*
  * Try to get console ownership to actually show the kernel
  * messages from a 'printk'. Return true (and with the
@@ -848,7 +850,7 @@ static int console_trylock_for_printk(unsigned int cpu, unsigned long flags)
 	int retval = 0, wake = 0;
 #ifdef CONFIG_PREEMPT_RT_FULL
 	int lock = (!early_boot_irqs_disabled && !irqs_disabled_flags(flags) &&
-		!preempt_count()) || sysrq_in_progress;
+		!preempt_count()) || sysrq_in_progress || boot_console_active;
 #else
 	int lock = 1;
 #endif
@@ -1653,6 +1655,7 @@ void register_console(struct console *newcon)
 		 */
 		printk(KERN_INFO "console [%s%d] enabled, bootconsole disabled\n",
 			newcon->name, newcon->index);
+		boot_console_active = 0;
 		for_each_console(bcon)
 			if (bcon->flags & CON_BOOT)
 				unregister_console(bcon);
-- 
1.7.7.6


             reply	other threads:[~2012-05-05  1:07 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-05  1:07 Venkat Subbiah [this message]
2012-05-17 21:33 ` patch to fix early printks with PREMPT_RT_FULL Venkat Subbiah
2012-05-18  1:30   ` Frank Rowand
2012-05-21 19:54     ` Venkat Subbiah
2012-05-21 20:12     ` Venkat Subbiah

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=4FA47D4A.6020009@caviumnetworks.com \
    --to=vsubbiah@caviumnetworks.com \
    --cc=linux-rt-users@vger.kernel.org \
    /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