Well, I finally tracked down the source of many (but probably not all)
of the problems which people were complaining about. There were too
problems. The first was that change_speed was being called in the wrong
place, so that if you were using the UART at 2400 baud for the first
time after bootup, the UART would not be initialized correctly. (Thanks
you, Linus, for calling this bug to my attention!)
The second bug had to do with how the serial driver handled programs
which set the baud rate to zero temporarily to force DTR down. Instead
of just dropping DTR, the old serial driver was shutting down the UART,
which caused DTR to be dropped *permanently*. (Since I normally use
kermit instead of minicom, I didn't notice this in my testing, because
kermit doesn't try setting the baud rate to zero.)
Bugs regarding internal modems (or possibly some wierd serial boards)
not being properly detected at boot time aren't addressed in this patch,
but that is mostly harmless. Bugs where a SCSI board is mistaken from a
UART are also not addressed here, although again it is mostly harmless.
People who are paranoid may wish to comment out the last two lines in
the rs_table[] structure in serial.c, however.
Linus, could you make sure these patches make it into the next release
of the kernel? Thanks!
- Ted
Priority: urgent (especially for those who have reported problems with
the serial driver)
*** 1.1 1992/10/24 12:37:29
--- serial.c 1992/10/24 14:54:10
***************
*** 405,412 ****
--- 405,414 ----
struct async_struct *info;
unsigned char mcr;
+ #ifdef notdef
printk("throttle tty%d: %d (%d, %d)....\n", DEV_TO_SL(tty->line),
status, LEFT(&tty->read_q), LEFT(&tty->secondary));
+ #endif
switch (status) {
case TTY_THROTTLE_RQ_FULL:
info = rs_table + DEV_TO_SL(tty->line);
***************
*** 556,562 ****
struct async_struct * info;
unsigned short port;
int quot = 0;
! unsigned cflag,cval;
int i;
if (line >= NR_PORTS)
--- 558,564 ----
struct async_struct * info;
unsigned short port;
int quot = 0;
! unsigned cflag,cval,mcr;
int i;
if (line >= NR_PORTS)
***************
*** 589,596 ****
quot = 0;
info->timeout = 0;
}
! if (!quot) {
! shutdown(info);
return;
}
/* byte size and parity */
--- 591,601 ----
quot = 0;
info->timeout = 0;
}
! mcr = inb(UART_MCR + port);
! if (quot)
! outb(mcr | UART_MCR_DTR, UART_MCR + port);
! else {
! outb(mcr & ~UART_MCR_DTR, UART_MCR + port);
return;
}
/* byte size and parity */
***************
*** 844,849 ****
--- 849,855 ----
IRQ_ISR[irq] = ISR;
}
startup(info);
+ change_speed(info->line);
return 0;
}
***************
*** 950,957 ****
}
} else
info->type = PORT_8250;
- startup(info);
- change_speed(info->line);
shutdown(info);
}
--- 956,961 ----| monstr | [PATCH 26/60] microblaze_v4: time support |
| Jon Smirl | Re: 463 kernel developers missing! |
| Andrew Morton | Re: x86: 4kstacks default |
| Greg KH | [GIT PATCH] driver core patches against 2.6.24 |
git: | |
| Gerrit Renker | [PATCH 15/37] dccp: Set per-connection CCIDs via socket options |
| Jarek Poplawski | [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock(). |
| David Miller | Re: [GIT]: Networking |
| Jiri Olsa | [PATCHv5 0/2] net: fix race in the receive/select |
