*BSD News Article 6972


Return to BSD News archive

Path: sserve!manuel.anu.edu.au!munnari.oz.au!sgiblab!sgigate!olivea!decwrl!elroy.jpl.nasa.gov!usc!rpi!batcomputer!cornell!cchase
From: cchase@cs.cornell.edu (Craig Chase)
Newsgroups: comp.unix.bsd
Subject: Re: STB 4-COM serial card, com driver
Summary: Lockups with com.c
Keywords: IRQ, port, multiport, com, driver
Message-ID: <1992Oct23.154021.27945@cs.cornell.edu>
Date: 23 Oct 92 15:40:21 GMT
References: <1992Oct21.124822.8843@netcom.com>
Organization: Electrical Engineering, Cornell University, Ithaca NY
Lines: 65

I had similar problems, not with the STB 4-COM, but with my Zoom internal
modem.  If the modem felt like being a pain, I would connect, type a couple
of characters and *zip*  the system locks up tight.  Time for the
little red button.  Under DOS it would work fine every time, under 386bsd
maybe one time in 5 it would work OK.

In my case, the problem appears to be related to the line status register
for the 16550.  My modem seems to refuse to reset line status problems
when you read from this register.  Unfortunately, that includes the 
IIR_RLS interrupt, and when you get one of these, you'll get a zillion
in an infinite succession.  386BSD locks up tight trying to service
all these interrupts.

I hacked out a crude solution by disabling this interupt, and adding a
break for a while loop.  Since I don't have documentation on the 16550,
and no time to spend (at present) to figure out what really is going
on, this major hack is fine for me.  I'll include the diffs to the
com.c at the end of this post.  If someone identifies a solution to this
problem, I'd appreciate hearing about it.

Craig

 diff -c com.c.terry com.c
*** com.c.terry Sun Oct 18 03:23:56 1992
--- com.c       Sun Oct 18 14:59:12 1992
***************
*** 327,334 ****
                                while ((code = inb(com+com_lsr)) & LSR_RCV_MASK) {
                                        if (code == LSR_RXRDY) {
                                                RCVBYTE();
!                                       } else
!                                               comeint(unit, code, com);
                                }
                        break;
                case IIR_TXRDY:
--- 327,338 ----
                                while ((code = inb(com+com_lsr)) & LSR_RCV_MASK) {
                                        if (code == LSR_RXRDY) {
                                                RCVBYTE();
!                                       } else {
!                                           /* This is a semi-serious hack by
!                                              C. M. Chase */
!                                           comeint(unit, code, com);
!                                           break;
!                                         }
                                }
                        break;
                case IIR_TXRDY:
***************
*** 341,346 ****
--- 345,352 ----
                        break;
                case IIR_RLS:
                        comeint(unit, inb(com+com_lsr), com);
+                         /* This is a hack by C. M. Chase */
+                         outb(com+com_ier, inb(com+com_ier) & ~IER_ERLS);
                        break;
                default:
                        if (code & IIR_NOPEND)

-- 
"They [La Prensa] accused us of suppressing freedom of
 expression.  This was a lie and we could not let them
 publish it."
 - Nelba Blandon, Interior Ministry Director of Censorship, quoted in