Serial flow control problem

Serial flow control problem

Post by Jim Troc » Tue, 28 Nov 1995 04:00:00



I seem to be having flow control problems using kernel 1.2.13 (with
BusLogic patches 1.2.0). My serial board has a 16450 on it (mouse
port), and a 16550AN (modem port). All works fine under DOS (no serial
port overruns using TeleMate downloading via zmodem at a port rate of
38400bps), but Linux is giving me errors on the port when receiving
data even at 19200bps. 98% of my modem use is consumed by PPP.

My modem (MultiTech ZDX 28.8K) is set to do hardware flow control,
using &E4 and &E13.

The /proc/net/dev report below an example of the error rate when sending
even a small amount of data. When lots of data are coming over the port
(e.g. FTPing a file), the error rate gets huge, roughly 10-20%.  Even
though the information below (especially stty -a results) might indicate
that RTS/CTS is enabled on the port, the nature of the errors seems to
indicate that hardware flow control isn't working.

Could this be a hardware problem? This serial card has worked before
without problems. It works under DOS (not very useful for me :).
I'm going to try a different serial card this week, but until then, please
have a look that this information.

The following is setup and diagnostic information.

Thanks in advance. I would appreciate replies being sent via e-mail.  I
will post a summary of the results (if there are any).

Jim Trocki

Agricultural Research & Development Division
American Cyanamid Company
Princeton, NJ
-----------------------------------------------------------------------------

Port A (mouse) is jumpered to be IRQ 4, port 0x3f8
Port B (modem) is jumpered to be IRQ 5, port 0x2f8
An IDE-only card is using IRQ 14
The VESA BusLogic 445C is using IRQ 11

The IDE controller is configured using hdparm -q -m 16 -u 1. I get the same
serial errors either way, so it doesn't seem to be interrupt latency caused
by slow IDE disks. I hardly use the IDE disks under Linux, anyway :)

Here is what happens in /etc/rc.d/rc.serial:

/sbin/setserial -q /dev/cua1 port 0x2f8 ^skip_test auto_irq autoconfig \
                spd_normal session_lockout
/sbin/setserial -b /dev/cua1
/bin/stty crtscts < /dev/cua1

I start pppd like this:

PORT=/dev/cua1
SPEED=19200
NETMASK=255.255.255.0
/usr/etc/pppd connect "/home/trok/annexdial.exp $DIALSTR $PASSCODE" \
$PORT $SPEED modem crtscts defaultroute netmask $NETMASK

$ dmesg (edited)
Serial driver version 4.11 with no serial options enabled
tty00 at 0x03f8 (irq = 4) is a 16450
tty01 at 0x02f8 (irq = 3) is a 16550A
ide0: primary interface on irq 14
scsi: ***** BusLogic SCSI Driver Version 1.2.0 of 13 November 1995 *****
scsi0: Configuring BusLogic Model 44xC VESA SCSI Host Adapter
scsi0:   Firmware Version: 4.25J, I/O Address: 0x334, IRQ Channel: 11/Edge
scsi0:   DMA Channel: None, BIOS Address: 0xDC000, Host Adapter SCSI ID: 7
IP Protocols: ICMP, UDP, TCP
PPP: version 0.2.7 (4 channels) NEW_TTY_DRIVERS OPTIMIZE_FLAGS
TCP compression code copyright 1989 Regents of the University of California
PPP line discipline registered.

$ cat /proc/net/dev (edited)
Inter-|   Receive                  |  Transmit
 face |packets errs drop fifo frame|packets errs drop fifo colls carrier
    lo:      0    0    0    0    0        0    0    0    0     0    0
  ppp0:     46    5    0    0    0       68    0    0    0     0    0

$ /sbin/setserial -a /dev/cua0
/dev/cua0, Line 0, UART: 16450, Port: 0x3f8, IRQ: 4
        Baud_base: 115200, close_delay: 50, divisor: 0
        Flags: spd_normal skip_test

$ /sbin/setserial -a /dev/cua1
/dev/cua1, Line 1, UART: 16550A, Port: 0x02f8, IRQ: 5
        Baud_base: 115200, close_delay: 50, divisor: 0
        Flags: spd_normal auto_irq session_lockout

$ stty -a < /dev/cua1 (crtscts seems to be set in the termios structure)
speed 9600 baud; rows 0; columns 0; line = 0;
intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = <undef>;
eol2 = <undef>; start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R; werase = ^W;
lnext = ^V; flush = ^O; min = 1; time = 0;
-parenb -parodd cs8 hupcl -cstopb cread clocal crtscts
-ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl ixon -ixoff
-iuclc -ixany -imaxbel
opost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0
isig icanon iexten echo echoe echok -echonl -noflsh -xcase -tostop -echoprt
echoctl e*

There seems to be no IRQ conflict between serial ports, because I
monitored the interrupts when moving the mouse and no modem activity,
and modem activity while the mouse was still, and all seemed fine (is
this a sane test? :)
$ cat /proc/interrupts
 0:   332977   timer
 1:     2892   keyboard
 2:        0 + cascade
 4:     4258 + serial
 5:     2434 + serial
11:     2331 + BusLogic 44xC
13:        1   math error
14:      525 + ide0

$ cat /proc/ioports
0000-001f : dma1
0020-003f : pic1
0040-005f : timer
0060-0060 : kbd
0064-0064 : kbd
0070-007f : rtc
0080-009f : dma page reg
00a0-00bf : pic2
00c0-00df : dma2
00f0-00f1 : npu
00f8-00ff : npu
01f0-01f7 : ide0
0201-0201 : joystick
02f8-02ff : serial(set)
0334-0337 : BusLogic 44xC
03d4-03d5 : ega+
03f6-03f6 : ide0
03f8-03ff : serial(auto)