Bug 3395 - sio2: not found, but there
Summary: sio2: not found, but there
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: 2.2.1-RELEASE
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 1997-04-27 19:30 UTC by dmm125
Modified: 1997-05-18 22:19 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description dmm125 1997-04-27 19:30:01 UTC
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.

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.
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.
Comment 1 sherwink 1997-05-05 07:57:09 UTC
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.
Comment 2 Bruce Evans 1997-05-06 02:48:28 UTC
>>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
Comment 3 Poul-Henning Kamp freebsd_committer freebsd_triage 1997-05-18 22:19:12 UTC
State Changed
From-To: open->closed


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