Skip to contentSkip to conversation

patch to fix early printks with PREMPT_RT_FULL

PATCH Venkat Subbiah 2 participants 5 messages May 5, 2012 – May 21, 2012

lore
Share & tools
lore
#0 lore raw

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

Quoted 1 line

From 876c0653e4482357823d1d36858aed7b5cd8d1fa Mon Sep 17 00:00:00 2001

From: Venkat Subbiah <[email protected]>
Date: Fri, 4 May 2012 17:53:16 -0700
Subject: [PATCH] printk: Allow early console prints with PREEMPT_RT_FULL

---
 kernel/printk.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
kernel/printk.c +4 -1
index d3f22ec..d2dda2f 100644
@@ -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);
Signature · 1 line
1.7.7.6
#1 lore raw

Thomas,
Is this patch going to make it to a release or should this sent be sent to more folks for review? Thanks,
Venkat

Quoted 15 lines · Venkat Subbiah

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

#2 lore raw
Quoted 6 lines · Venkat Subbiah

Thomas,
Is this patch going to make it to a release or should this sent be sent to more folks for review?
Thanks,
Venkat

Quoted 8 lines
Quoted 7 lines · Venkat Subbiah

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.

Venkat,

Do my patches from yesterday solve problem #1 for you? (I can't test for your problem, because I don't see it on my ARM system.)

http://marc.info/?l=linux-rt-users&m=133721694105947&w=2

http://marc.info/?l=linux-rt-users&m=133721717706004&w=2

For problem #2, does that also exist without the RT patches?

-Frank

#3 lore raw
Quoted 12 lines · Frank Rowand
Quoted 11 lines · Venkat Subbiah

Thomas,
Is this patch going to make it to a release or should this sent be sent to more folks for review?
Thanks,
Venkat

Quoted 4 lines · Venkat Subbiah

Hello,

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

Quoted 7 lines
Quoted 3 lines
Quoted 3 lines

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.

Venkat,

Do my patches from yesterday solve problem #1 for you? (I can't test for your problem, because I don't see it on my ARM system.)

The patch doe solve both #1 and #2. Thanks.
-Venkat

Quoted 10 lines
    http://marc.info/?l=linux-rt-users&m=133721694105947&w=2

    http://marc.info/?l=linux-rt-users&m=133721717706004&w=2

For problem #2, does that also exist without the RT patches?

-Frank

#4 lore raw
In reply to Frank Rowand
Quoted 12 lines · Frank Rowand
Quoted 11 lines · Venkat Subbiah

Thomas,
Is this patch going to make it to a release or should this sent be sent to more folks for review?
Thanks,
Venkat

Quoted 4 lines · Venkat Subbiah

Hello,

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

Quoted 7 lines
Quoted 3 lines
Quoted 3 lines

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.

Venkat,

Do my patches from yesterday solve problem #1 for you? (I can't test for your problem, because I don't see it on my ARM system.)

Frank,

Looks like the fix is not architecture specific. Curious as to why it doesn't show up on ARM?

Thanks,
Venkat

Quoted 10 lines
    http://marc.info/?l=linux-rt-users&m=133721694105947&w=2

    http://marc.info/?l=linux-rt-users&m=133721717706004&w=2

For problem #2, does that also exist without the RT patches?

-Frank