Discussion:
Garbage on serial console after serial driver loads
(too old to reply)
Luca
2005-03-25 21:05:12 UTC
Permalink
I attached a null modem cable to my notebook and I'm seeing garbage as
soon as the serial driver is loaded. I tried booting with init=/bin/bash
to be sure that it's not some rc script doing strange things to the
serial port, but this didn't solve the problem.
* serial debugging enabled (which isn't compatible with serial console)
Do you mean #define DEBUG in serial_core.c? No.
* a NS16550A, in which case dwmw2 needs to rework his autodetect code to
adjust the baud rate appropriately.
Well, serial_core seems to think so:

Serial: 8250/16550 driver $Revision: 1.90 $ 8 ports, IRQ sharing disabled
ttyS0 at I/O 0x3f8 (irq = 4) is a NS16550A
ttyS1 at I/O 0x2f8 (irq = 3) is a NS16550A
ttyS0 at I/O 0x3f8 (irq = 4) is a NS16550A

Luca
--
Home: http://kronoz.cjb.net
La mia opinione puo` essere cambiata, ma non il fatto che ho ragione.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to ***@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



-------------------------------------------------------------------------------
Achtung: diese Newsgruppe ist eine unidirektional gegatete Mailingliste.
Antworten nur per Mail an die im Reply-To-Header angegebene Adresse.
Fragen zum Gateway -> ***@inka.de.
-------------------------------------------------------------------------------
Russell King
2005-03-25 20:43:31 UTC
Permalink
I attached a null modem cable to my notebook and I'm seeing garbage as
soon as the serial driver is loaded. I tried booting with init=/bin/bash
to be sure that it's not some rc script doing strange things to the
serial port, but this didn't solve the problem.
I'm uncertain how this problem can occur, unless you have one of:

* serial debugging enabled (which isn't compatible with serial console)
* a NS16550A, in which case dwmw2 needs to rework his autodetect code to
adjust the baud rate appropriately.

I suspect your case is the latter.
--
Russell King
Linux kernel 2.6 ARM Linux - http://www.arm.linux.org.uk/
maintainer of: 2.6 Serial core
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to ***@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



-------------------------------------------------------------------------------
Achtung: diese Newsgruppe ist eine unidirektional gegatete Mailingliste.
Antworten nur per Mail an die im Reply-To-Header angegebene Adresse.
Fragen zum Gateway -> ***@inka.de.
-------------------------------------------------------------------------------
Jan Engelhardt
2005-03-26 10:17:58 UTC
Permalink
Post by Luca
Serial: 8250/16550 driver $Revision: 1.90 $ 8 ports, IRQ sharing disabled
ttyS0 at I/O 0x3f8 (irq = 4) is a NS16550A
ttyS1 at I/O 0x2f8 (irq = 3) is a NS16550A
ttyS0 at I/O 0x3f8 (irq = 4) is a NS16550A
Does it work if you set the baud rate manually, as a bootloader option?

Jan Engelhardt
--
No TOFU for me, please.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to ***@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



-------------------------------------------------------------------------------
Achtung: diese Newsgruppe ist eine unidirektional gegatete Mailingliste.
Antworten nur per Mail an die im Reply-To-Header angegebene Adresse.
Fragen zum Gateway -> ***@inka.de.
-------------------------------------------------------------------------------
Russell King
2005-03-26 15:12:10 UTC
Permalink
Post by Jan Engelhardt
Post by Luca
Serial: 8250/16550 driver $Revision: 1.90 $ 8 ports, IRQ sharing disabled
ttyS0 at I/O 0x3f8 (irq = 4) is a NS16550A
ttyS1 at I/O 0x2f8 (irq = 3) is a NS16550A
ttyS0 at I/O 0x3f8 (irq = 4) is a NS16550A
Does it work if you set the baud rate manually, as a bootloader option?
Doesn't matter. The problem is that dwmw2's NS16550A patch (from ages
ago) changes the prescaler setting for this device so we can use the
higher speed baud rates. This means any programmed divisor (programmed
at early serial console initialisation time) suddenly becomes wrong as
soon as we fiddle with the prescaler during normal UART initialisation
time.

I think the argument for not initialising serial console _until_ after
UART initialisation time is gaining more technical merit:

1. spinlock initialisation issues (see other threads)
2. prescaler/divisor interaction issues (this thread)

even though it isn't _that_ desirable.
--
Russell King
Linux kernel 2.6 ARM Linux - http://www.arm.linux.org.uk/
maintainer of: 2.6 Serial core
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to ***@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



-------------------------------------------------------------------------------
Achtung: diese Newsgruppe ist eine unidirektional gegatete Mailingliste.
Antworten nur per Mail an die im Reply-To-Header angegebene Adresse.
Fragen zum Gateway -> ***@inka.de.
-------------------------------------------------------------------------------
Phil Oester
2005-03-26 15:57:52 UTC
Permalink
Post by Russell King
Doesn't matter. The problem is that dwmw2's NS16550A patch (from ages
ago) changes the prescaler setting for this device so we can use the
higher speed baud rates. This means any programmed divisor (programmed
at early serial console initialisation time) suddenly becomes wrong as
soon as we fiddle with the prescaler during normal UART initialisation
time.
FWIW, I see the same thing here on some Dell Poweredge boxes:

serio: i8042 AUX port at 0x60,0x64 irq 12
serio: i8042 KBD port at 0x60,0x64 irq 1
Serial: 8250/16550 driver $Revision: 1.90 $ 8 ports, IRQ sharing disabled
ttyS0 at I/O 0x3f8 (irq = 4) is a NS16550A
ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A
<garbage>

But intererstingly, on identical boxes, the garbage only appears on
those hooked up to a PortMaster device - those using a Cyclades never
display this problem. (???)

Phil
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to ***@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



-------------------------------------------------------------------------------
Achtung: diese Newsgruppe ist eine unidirektional gegatete Mailingliste.
Antworten nur per Mail an die im Reply-To-Header angegebene Adresse.
Fragen zum Gateway -> ***@inka.de.
-------------------------------------------------------------------------------
Russell King
2005-03-26 16:39:23 UTC
Permalink
Post by Phil Oester
Post by Russell King
Doesn't matter. The problem is that dwmw2's NS16550A patch (from ages
ago) changes the prescaler setting for this device so we can use the
higher speed baud rates. This means any programmed divisor (programmed
at early serial console initialisation time) suddenly becomes wrong as
soon as we fiddle with the prescaler during normal UART initialisation
time.
serio: i8042 AUX port at 0x60,0x64 irq 12
serio: i8042 KBD port at 0x60,0x64 irq 1
Serial: 8250/16550 driver $Revision: 1.90 $ 8 ports, IRQ sharing disabled
ttyS0 at I/O 0x3f8 (irq = 4) is a NS16550A
ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A
<garbage>
But intererstingly, on identical boxes, the garbage only appears on
those hooked up to a PortMaster device - those using a Cyclades never
display this problem. (???)
Sorry, I don't understand your scenarios. Can you explain the
circumstances under which you see corruption?

From the kernel messages you've quoted above, I can only think that
you're not using ttyS0 as the serial console - if you were, my
understanding of this issue would indicate that you should get the
garbage immediately after the line starting "Serial:"

Either my understanding of the cause of this problem is wrong, or
I'm not understanding your setup.
--
Russell King
Linux kernel 2.6 ARM Linux - http://www.arm.linux.org.uk/
maintainer of: 2.6 Serial core
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to ***@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



-------------------------------------------------------------------------------
Achtung: diese Newsgruppe ist eine unidirektional gegatete Mailingliste.
Antworten nur per Mail an die im Reply-To-Header angegebene Adresse.
Fragen zum Gateway -> ***@inka.de.
-------------------------------------------------------------------------------
Phil Oester
2005-03-26 17:22:18 UTC
Permalink
Post by Russell King
Post by Phil Oester
But intererstingly, on identical boxes, the garbage only appears on
those hooked up to a PortMaster device - those using a Cyclades never
display this problem. (???)
Sorry, I don't understand your scenarios. Can you explain the
circumstances under which you see corruption?
From the kernel messages you've quoted above, I can only think that
you're not using ttyS0 as the serial console - if you were, my
understanding of this issue would indicate that you should get the
garbage immediately after the line starting "Serial:"
Either my understanding of the cause of this problem is wrong, or
I'm not understanding your setup.
I have a number of PowerEdge 2550 servers. All are setup with serial
console on ttyS0 @ 9600. One group uses a (old) Portmaster device for console
access, the other group uses a Cyclades device. Only those servers
using the Portmaster device exhibit the garbage problem. The Cyclades
group never displays garbage on boot.

Phil

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to ***@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



-------------------------------------------------------------------------------
Achtung: diese Newsgruppe ist eine unidirektional gegatete Mailingliste.
Antworten nur per Mail an die im Reply-To-Header angegebene Adresse.
Fragen zum Gateway -> ***@inka.de.
-------------------------------------------------------------------------------
Phil Oester
2005-03-26 17:25:08 UTC
Permalink
Post by Phil Oester
serio: i8042 AUX port at 0x60,0x64 irq 12
serio: i8042 KBD port at 0x60,0x64 irq 1
Serial: 8250/16550 driver $Revision: 1.90 $ 8 ports, IRQ sharing disabled
Garbage here

Sorry -- I was relying upon my (flawed) memory of the bootup sequence,
but sending you the contents from /var/log/dmesg.

Phil
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to ***@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



-------------------------------------------------------------------------------
Achtung: diese Newsgruppe ist eine unidirektional gegatete Mailingliste.
Antworten nur per Mail an die im Reply-To-Header angegebene Adresse.
Fragen zum Gateway -> ***@inka.de.
-------------------------------------------------------------------------------
Jan Engelhardt
2005-03-27 11:14:47 UTC
Permalink
Hi,

I have come across a 16550A myself (in VMware) and so, tested it.
Linux reports it as a "16550A" while OpenBSD says it's a "NS16550A" --
output to this serial console (vmware: file) works fine, though.

My real box's serial is also a 16550A but havenot tested that- got no cable.

Jan Engelhardt
--
No TOFU for me, please.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to ***@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



-------------------------------------------------------------------------------
Achtung: diese Newsgruppe ist eine unidirektional gegatete Mailingliste.
Antworten nur per Mail an die im Reply-To-Header angegebene Adresse.
Fragen zum Gateway -> ***@inka.de.
-------------------------------------------------------------------------------
Phil Oester
2005-03-28 17:40:45 UTC
Permalink
Doesn't matter. The problem is that dwmw2's NS16550A patch (from ages
ago) changes the prescaler setting for this device so we can use the
higher speed baud rates. This means any programmed divisor (programmed
at early serial console initialisation time) suddenly becomes wrong as
soon as we fiddle with the prescaler during normal UART initialisation
time.
Seems like you are correct, given the below patch fixes the garbage
output for me.

Phil
Russell King
2005-03-28 19:05:36 UTC
Permalink
Post by Phil Oester
Doesn't matter. The problem is that dwmw2's NS16550A patch (from ages
ago) changes the prescaler setting for this device so we can use the
higher speed baud rates. This means any programmed divisor (programmed
at early serial console initialisation time) suddenly becomes wrong as
soon as we fiddle with the prescaler during normal UART initialisation
time.
Seems like you are correct, given the below patch fixes the garbage
output for me.
David,

Is this patch ok for you?

--- linux-standard/drivers/serial/8250.c 2005-03-02 02:37:47.000000000 -0500
+++ linux-dellfw/drivers/serial/8250.c 2005-03-28 12:28:34.560032856 -0500
@@ -698,7 +698,7 @@
serial_outp(up, UART_MCR, status1);

if ((status2 ^ status1) & UART_MCR_LOOP) {
-#ifndef CONFIG_PPC
+#if 0
serial_outp(up, UART_LCR, 0xE0);
status1 = serial_in(up, 0x04); /* EXCR1 */
status1 &= ~0xB0; /* Disable LOCK, mask out PRESL[01] */
--
Russell King
Linux kernel 2.6 ARM Linux - http://www.arm.linux.org.uk/
maintainer of: 2.6 Serial core
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to ***@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



-------------------------------------------------------------------------------
Achtung: diese Newsgruppe ist eine unidirektional gegatete Mailingliste.
Antworten nur per Mail an die im Reply-To-Header angegebene Adresse.
Fragen zum Gateway -> ***@inka.de.
-------------------------------------------------------------------------------
Dave Airlie
2005-03-29 00:01:59 UTC
Permalink
Post by Russell King
Post by Phil Oester
Seems like you are correct, given the below patch fixes the garbage
output for me.
David,
Is this patch ok for you?
Just an aside, I've had this patch in my own internal tree for over a
year I never thought it would be kernel acceptable... but I noticed
this problem a long time ago and thought it was an issue with my
internal hardware as I never saw it on a normal board...

Dave.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to ***@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



-------------------------------------------------------------------------------
Achtung: diese Newsgruppe ist eine unidirektional gegatete Mailingliste.
Antworten nur per Mail an die im Reply-To-Header angegebene Adresse.
Fragen zum Gateway -> ***@inka.de.
-------------------------------------------------------------------------------
Loading...