Subject: kern/15448: com at isa can't cope well >230kbps
To: None <gnats-bugs@gnats.netbsd.org>
From: None <wojtek@chylonia.3miasto.net>
List: netbsd-bugs
Date: 01/31/2002 13:01:39
>Number:         15448
>Category:       kern
>Synopsis:       com at isa can't cope well >230kbps
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Thu Jan 31 13:02:00 PST 2002
>Closed-Date:
>Last-Modified:
>Originator:     Wojciech Puchar
>Release:        1.5.2
>Organization:
TENSOR ap
>Environment:
NetBSD router.posejdon.3miasto.net 1.5.2 NetBSD 1.5.2 (router.posejdon) #3: Thu Jan 31 21:40:44 CET 2002     root@chylonia.3miasto.net:/usr/src/sys/arch/i386/compile/router.posejdon i386

>Description:
ISA com driver con't cope with interrupt load on ISA based 16550A cards
with speed 460kbps or more (in contrast to 16650 based PCI cards which works perfect)
>How-To-Repeat:
use pppd on 460kbps link with ISA RS-232 card. 
system works SLOOOOW and lots of silo overflows appear
it does not depend much of CPU speed (similar on 486/25 with slow RAM and 486/80 with
60ns RAM and even on pentium)
>Fix:
it looks like original com code author though that on high speed CPU reaction can be 
slow and he/she turns threshold lower on high speed.

this patch turns this highest possible (at 14 of 16 bytes) as CPU is enough fast
to react, but this generates 14/4=3.5 times less interrupts on ISA

however i did no test on REALLY slow machine (386SX).
maybe it should be option for this.


--- com.c.orig  Thu Jan 31 21:33:40 2002
+++ com.c       Thu Jan 31 21:40:16 2002
@@ -1414,7 +1414,8 @@
        else if (ISSET(sc->sc_hwflags, COM_HW_FIFO))
                sc->sc_fifo = FIFO_ENABLE |
                    (t->c_ospeed <= 1200 ? FIFO_TRIGGER_1 :
-                    t->c_ospeed <= 38400 ? FIFO_TRIGGER_8 : FIFO_TRIGGER_4);
+//                  t->c_ospeed <= 38400 ? FIFO_TRIGGER_8 : FIFO_TRIGGER_4);
+                    FIFO_TRIGGER_14);
        else
                sc->sc_fifo = 0;

>Release-Note:
>Audit-Trail:
>Unformatted: