*BSD News Article 27040


Return to BSD News archive

Path: sserve!newshost.anu.edu.au!munnari.oz.au!metro!ultima!kralizec.zeta.org.au!godzilla.zeta.org.au!not-for-mail
From: bde@kralizec.zeta.org.au (Bruce Evans)
Newsgroups: comp.os.386bsd.questions
Subject: Re: The Stray Interrupt Problem (7) under NetBSD ?
Date: 5 Feb 1994 05:41:04 +1100
Organization: Kralizec Dialup Unix Sydney - +61-2-837-1183, v.32bis and v.42bis
Lines: 48
Message-ID: <2iu4s0INN1bv@godzilla.zeta.org.au>
References: <1994Jan28.222149.12886@sifon.cc.mcgill.ca> <MYCROFT.94Jan30231828@duality.gnu.ai.mit.edu> <2ilr1i$6fl@hrd769.brooks.af.mil> <2im84d$ahk@pdq.coe.montana.edu>
NNTP-Posting-Host: godzilla.zeta.org.au

In article <2im84d$ahk@pdq.coe.montana.edu>,
Nate Williams <nate@bsd.coe.montana.edu> wrote:
>In article <2ilr1i$6fl@hrd769.brooks.af.mil>,
>Dave Burgess <burgess@hrd769.brooks.af.mil> wrote:
>>It this example, I would think that a much more likely culprit than random
>>lpt interrupts would be that the cable in this case was bad/marginal.
>
>The interrupt 7's are caused by interrupts that are sent but not received.
>
>So, if the wd driver sends out an interrupt but some other driver (or itself)
>blocks interrupts for too long a time then a stray interrupt is generrated.

No.  Most interrupts stay on "forever" until they are acknowledged.  Of the
ones that turn off by themself, a stray interrupt is only generated if they
turn off at the "same" time (within about 0.5 usec) as they are about to be
acknowledged.  This is very unlikely for wd interrupts.  It is much more
likely for printer interrupts.  Printer interrupts may be on for as short
as 6 usec, and are turned off by the printer, independent of any
acknowledgements from the system.  6 usec is quite close to the (relevant)
interrupt latency for NetBSD and FreeBSD.

Stray interrupts may be caused by drivers returning from interrupt handlers
too fast for slow devices, something like this:

cpu+8259	driver			device
------		------			------
		read device status reg	starts thinking about turning off intr
		enable intr in ICU	still thinking
INTA cycle begins			turns off intr
INTA aborted, IRQ7 generated

>Most/All of the stray interrupts caused by the WD driver are now fixed in
>the driver in FreeBSD-current.  Bruce Evans worked hard at getting the driver
>to have the correct timings, and although I didn't test it as thoroughly as I
>would like (kind of difficult when your main development machine is a SCSI
>box)

Well, I fixed the unexpected "extra" interrupts (by expecting them), and
someone else improved the timings, but I don't know exactly what caused
the stray interrupts from the wd driver.  I saw them only after bogus
error recovery in a new timeout routine.  I used to think that the device
got confused and toggled the interrupt line too fast; now I think that
the interrupt handler returned too fast for interrupts that it didn't
expect and caused the above problem.

Bruce
-- 
Bruce Evans  bde@kralizec.zeta.org.au