2.1.95 patch for serial consoles

Keith Owens (kaos@ocs.com.au)
Sat, 11 Apr 1998 23:29:29 +1000


No matter which serial console you specify, printk.c calls console
setup for ttyS0. Trying to use a serial console on ttyS1 when it has
not been correctly initialised is *painful*. This bug has been there
since at least 2.1.84. Also a paranoia patch to the serial console
setup code, the hardware should have started with DLAB off but just in
case ...

Index: linux/kernel/printk.c
--- linux/kernel/printk.c.orig Sat, 04 Apr 1998 19:51:10 +1000 keith (linux-2.1/X/4_printk.c 1.2.1.9 644) 95.1
+++ linux/kernel/printk.c Sat, 11 Apr 1998 23:14:10 +1000 keith (linux-2.1/X/4_printk.c 1.2.1.9 644) 95.1(w)
@@ -358,7 +358,8 @@
if (console->index >= 0 &&
console->index != console_cmdline[i].index)
continue;
- if (console->index < 0) console->index = 0;
+ if (console->index < 0)
+ console->index = console_cmdline[i].index;
if (console->setup &&
console->setup(console, console_cmdline[i].options) != 0)
break;
Index: linux/drivers/char/serial.c
--- linux/drivers/char/serial.c.orig Sat, 04 Apr 1998 19:51:10 +1000 keith (linux-2.1/w/18_serial.c 1.4.2.6 644) 95.1
+++ linux/drivers/char/serial.c Sat, 11 Apr 1998 23:12:08 +1000 keith (linux-2.1/w/18_serial.c 1.4.2.6 644) 95.1(w)
@@ -3613,6 +3613,7 @@
* Disable UART interrupts, set DTR and RTS high
* and set speed.
*/
+ outb(cval, ser->port + UART_LCR); /* don't assume that DLAB is clear */
outb(0, ser->port + UART_IER);
outb(UART_MCR_DTR | UART_MCR_RTS, ser->port + UART_MCR);
outb(cval | UART_LCR_DLAB, ser->port + UART_LCR); /* set DLAB */

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu