From nobody  Sun Apr 27 11:20:37 1997
Received: (from nobody@localhost)
          by hub.freebsd.org (8.8.5/8.8.5) id LAA21901;
          Sun, 27 Apr 1997 11:20:37 -0700 (PDT)
Message-Id: <199704271820.LAA21901@hub.freebsd.org>
Date: Sun, 27 Apr 1997 11:20:37 -0700 (PDT)
From: dmm125@bellatlantic.net
To: freebsd-gnats-submit@freebsd.org
Subject: sio2: not found, but there
X-Send-Pr-Version: www-1.0

>Number:         3395
>Category:       kern
>Synopsis:       sio2: not found, but there
>Confidential:   no
>Severity:       critical
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:
>Keywords:
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Apr 27 11:30:01 PDT 1997
>Closed-Date:    Sun May 18 14:19:12 PDT 1997
>Last-Modified:  Sun May 18 14:19:54 PDT 1997
>Originator:     Donn Miller
>Release:        2.2.1-RELEASE
>Organization:
>Environment:
i386 16MHz
>Description:
sio2 was configured for correct port and irq, but was not being
probed.  Turned on flags 0x80 to find failing routine.  Said probe
test 3 failed.  Tried adjusting DELAY() values before failure[3]
to no avail.
>How-To-Repeat:
just reboot with internal modem with correct irq and port address set
(proper sio? enabled, of course), in 2.2.1 RELEASE.
>Fix:
in /sys/i386/isa/sio.c, apply this patch:

DELAY(10000);           /* Some internal modems need this time */
        if (idev->id_irq != 0)
-                failures[3] = isa_irq_pending(idev) ? 0 : 1;
+                failures[3] = isa_irq_pending(idev) ? 1 : 0;
        failures[4] = (inb(iobase + com_iir) & IIR_IMASK) - IIR_TXRDY;

Anyhow, this is what my sio.c said.  In the above at '-', it is implying
that probe test 3 will fail if there is no irq pending, which is
the opposite of what we want.       
>Release-Note:
>Audit-Trail:

From: Sherwin <sherwink@ix.netcom.com>
To: freebsd-gnats-submit@freebsd.org, dmm125@bellatlantic.net
Cc:  Subject: Re: kern/3395: sio2: not found, but there
Date: Sun, 04 May 1997 23:57:09 -0700

 I have the same problem with sio0, every few boots. If I reboot, then
 sio0 is found. There does not seem to be a pattern. I have only sio0 and
 sio3 configured, with sio3 being an internal modem. The kernel always
 finds sio3.
 
 I was ready to replace the controller/port card when I read this, so it
 saved me buying a new one.

From: Bruce Evans <bde@zeta.org.au>
To: dmm125@bellatlantic.net, freebsd-gnats-submit@freebsd.org
Cc:  Subject: Re: kern/3395: sio2: not found, but there
Date: Tue, 6 May 1997 11:48:28 +1000

 >>Fix:
 >in /sys/i386/isa/sio.c, apply this patch:
 >
 >DELAY(10000);           /* Some internal modems need this time */
 >        if (idev->id_irq != 0)
 >-                failures[3] = isa_irq_pending(idev) ? 0 : 1;
 >+                failures[3] = isa_irq_pending(idev) ? 1 : 0;
 >        failures[4] = (inb(iobase + com_iir) & IIR_IMASK) - IIR_TXRDY;
 >
 >Anyhow, this is what my sio.c said.  In the above at '-', it is implying
 >that probe test 3 will fail if there is no irq pending, which is
 >the opposite of what we want.       
 
 Normally there is an irq pending.  Reversing the test would break it for
 few hundred thousand sio ports where it usually works :-).  For a better
 work around, just ignore the result of the test.  isa_irq_pending() has
 no side effects, so you could omit the whole test in this case, but some
 of the other tests have side effects, so it is simplest to set failures[N]
 back to 0 if test N doesn't work (or do all the tests and ignore all the
 results).
 
 If you have other sio ports, then you should configure them even if you
 don't use them, since their IRQs may conflict.
 
 Bruce
State-Changed-From-To: open->closed 
State-Changed-By: phk 
State-Changed-When: Sun May 18 14:19:12 PDT 1997 
State-Changed-Why:  

I have added code to -current such that flags 0x1000 disables test#3. 
>Unformatted:
