Skip to contentSkip to conversation

powerpc: Quiet hvc_console console output on failed opens

PATCH In review Olof Johansson 3 participants 4 messages Sep 7, 2006 – Sep 11, 2006 Char and misc drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 powerpc: Quiet hvc_console console output on failed opens

Hi,

Please consider for the 2.6.19 queue:

No other tty driver will print on the console when the open of it fails.

On systems that happen to be configured for both ttyS0 and hvc0 console, this will keep flooding the console output. This is most likely to happen with systems booted between with and without hypervisor from the same filesystem.

Let's just remove it. When it's really needed (i.e. when the open fails and someone is trying to debug it), noone will see the output anyway. And init will report the opens failing in due time through the syslog.

drivers/char/hvc_console.c +1 -3
Index: merge/drivers/char/hvc_console.c
===================================================================
@@ -320,10 +320,8 @@ static int hvc_open(struct tty_struct *t
 	struct kobject *kobjp;
 
 	/* Auto increments kobject reference if found. */
-	if (!(hp = hvc_get_by_index(tty->index))) {
-		printk(KERN_WARNING "hvc_console: tty open failed, no vty associated with tty.\n");
+	if (!(hp = hvc_get_by_index(tty->index)))
 		return -ENODEV;
-	}
 
 	spin_lock_irqsave(&hp->lock, flags);
 	/* Check and then increment for fast path open. */
#1 lore raw
Quoted 26 lines · Olof Johansson

Hi,

Please consider for the 2.6.19 queue:

No other tty driver will print on the console when the open of it fails.

On systems that happen to be configured for both ttyS0 and hvc0 console, this will keep flooding the console output. This is most likely to happen with systems booted between with and without hypervisor from the same filesystem.

Let's just remove it. When it's really needed (i.e. when the open fails and someone is trying to debug it), noone will see the output anyway. And init will report the opens failing in due time through the syslog.

Index: merge/drivers/char/hvc_console.c
===================================================================

drivers/char/hvc_console.c +0 -0
@@ -320,10 +320,8 @@ static int hvc_open(struct tty_struct *t
 	struct kobject *kobjp;

drivers/char/hvc_console.c static int hvc_open(struct tty_struct *t · line 327

Quoted 10 lines
drivers/char/hvc_console.c +1 -3
 
 	/* Auto increments kobject reference if found. */
-	if (!(hp = hvc_get_by_index(tty->index))) {
-		printk(KERN_WARNING "hvc_console: tty open failed, no vty associated with tty.\n");
+	if (!(hp = hvc_get_by_index(tty->index)))
 		return -ENODEV;
-	}
 
 	spin_lock_irqsave(&hp->lock, flags);
 	/* Check and then increment for fast path open. */

This seems like a good fix to me. I think it is a debug artifact anyway.

Signature · 3 lines
Ryan S. Arnold <[email protected]>
IBM Linux Technology Center
Linux on Power Toolchain
#2 lore raw
Quoted 2 lines · Ryan Arnold

This seems like a good fix to me. I think it is a debug artifact anyway.

So, does that amount to an Acked-by?

Paul.

Acked-by
#3 lore raw
Quoted 8 lines · Paul Mackerras
Quoted 2 lines · Ryan Arnold

This seems like a good fix to me. I think it is a debug artifact anyway.

So, does that amount to an Acked-by?

Paul.

Yes, take that as an:

Signature · 3 lines
Ryan S. Arnold <[email protected]>
IBM Linux Technology Center
Linux on Power Toolchain