From: Theodore Ts'o (tytso@athena.mit.edu)
Date: 05/28/93


From: Theodore Ts'o <tytso@athena.mit.edu>
Subject: Patch to ALPHA-pl10: serial.c
Date: 28 May 1993 01:35:43 -0400

The following patch to serial.c in the ALPHA-pl10 distribution fixes two
bugs; the first is one which will crash the machine if you configure a
non-existent serial port using setserial with the irq set to 0, and then
open it.

The second patch protects restart_port() in case it ever gets called
with a null argument.

The other important announcement is that starting with pl10, only the
standard COM1-4 ports will be configured at boot time. If you have any
other serial ports, you *must* get the setserial version 2.01 (found on
tsx-11:/pub/linux/sources/sbin/setserial-2.01.tar.z) and install it and
the /etc/rc.serial file found in that package. See the README file in
setserial version 2.01 for more details.

Could all Linux distributors make sure that any Linux distributions
incorporating the pl10 kernel also include setserial version 2.01, and
use /etc/rc.serial? Thanks!

                                                - Ted

*** 1.1 1993/05/28 03:54:00
--- serial.c 1993/05/28 05:20:26
***************
*** 248,254 ****
                 * free in the queue; otherwise we punt.
                 */
                if (VLEFT < 2)
! continue;
                if (*status & info->read_status_mask) {
                        set_bit(head, &info->tty->readq_flags);
                        if (*status & (UART_LSR_BI)) {
--- 248,254 ----
                 * free in the queue; otherwise we punt.
                 */
                if (VLEFT < 2)
! break;
                if (*status & info->read_status_mask) {
                        set_bit(head, &info->tty->readq_flags);
                        if (*status & (UART_LSR_BI)) {
***************
*** 766,771 ****
--- 766,773 ----
        struct tty_queue * queue;
        int head, tail, count;
        
+ if (!info)
+ return;
        if (serial_inp(info, UART_LSR) & UART_LSR_THRE) {
                if (info->x_char) {
                        serial_outp(info, UART_TX, info->x_char);