*BSD News Article 23513


Return to BSD News archive

Path: sserve!newshost.anu.edu.au!munnari.oz.au!metro!sequoia!ultima!kralizec.zeta.org.au!not-for-mail
From: bde@kralizec.zeta.org.au (Bruce Evans)
Newsgroups: comp.os.386bsd.questions
Subject: Re: The reason for stray interrupts
Date: 30 Oct 1993 09:21:17 +1000
Organization: Kralizec Dialup Unix Sydney: +61-2-837-1183 V.32bis
Lines: 33
Message-ID: <2as8hd$op6@kralizec.zeta.org.au>
References: <2ais9gINN2t8@xs4all.hacktic.nl> <2alpnh$1cm@werple.apana.org.au> <vandys.751745453@cisco.com>
NNTP-Posting-Host: kralizec.zeta.org.au

In <vandys.751745453@cisco.com> vandys@cisco.com (Andrew Valencia) writes:

>Sigh.

>The problem is the way interrupts are cleared from the two chained
>PIC's.  If you disable the chained IRQ to the second PIC, or if you
>use auto-EIO mode, or if you use selective EOI to finish a pending
>interrupt, it doesn't happen.  The simplistic code which shotguns
>the two PICs in a row unconditionally is at fault.

Sigh.  I think this doesn't apply to most systems, at least for 0.1
and later versions of 386BSD.  0.1 does the pair of EOI's in the
"wrong" order, but this shouldn't matter because stray interrupts
are only supposed to happen when an interrupt goes away during the
interrupt ACK cycle, and interrupts are disabled so there won't be
another interrupt ACK cycle for some time.

0.0 did the EOI's at the end of the interrupt instead of at the
start.  This might have caused stray interrupts iff interrupts
were not disabled.

The 0.2.4 patchkit and later versions have ifdefs to enable auto-EOI.
I enable them but I tell everyone not to enable them both because
auto-EOI is documented not to work for the slave.  I think it might
cause stray interrupts because of timing problems :-).  Perhaps this
depends on whether the system uses interrupt gates or trap gates
for interrupts.  There should be no problems using interrupt gates
gates, for the reasons given above.  386BSD uses interrupt gates.
I think linux uses trap gates (relying on the 8259's interrupt
priorities for locking).  8088 systems use interrupt gates because
trap gates are not an option.
-- 
Bruce Evans  bde@kralizec.zeta.org.au