Subject: Re: ex0 weird error
To: Peter Seebach <seebs@plethora.net>
From: Michael L. Hitch <mhitch@lightning.msu.montana.edu>
List: current-users
Date: 12/14/2000 14:14:27
On Thu, 14 Dec 2000, Peter Seebach wrote:

> In message <20001214132821.A20424@noc.untraceable.net>, Andrew Brown writes:
> >i don't think it did.  the first of the two line changes seems to have
> >gone in in a slightly altered form.  the second one-liner doesn't look
> >like it went in.  here it is again.
> 
> On second thought, I'm not sure how to usefully apply this change.
> 
...
> Note the subtle difference:
> 	* Originally, we did the "break" if S_MASK wasn't set.
> 	* The old patch changed it to break if *neither* S_MASK *nor*
> 	  S_INTR_LATCH was set.
> 	* Now we do that to, but we spell it out so we can have an #if'd
> 	  out printf about clearing an intr_latch.
> 
> 		bus_space_write_2(iot, ioh, ELINK_COMMAND, ACK_INTR |
> 				  (stat & S_MASK));
> 
> ... but we don't seem to have S_INTR_LATCH here.
> 
> I'm going to tentatively go ahead and put S_INTR_LATCH back here, but I would
> love it if someone who understands the card could explain what's happening.

  I don't understand the card, but I submitted the original PR on this
problem.  The only thing I know is that the elinkxl seems to interrupt
once in a while with only the S_INTR_LATCH status bit set.  The write of
C_INTR_LATCH apparently clears the S_INTR_LATCH status bit, but since none
of the other status bits are set at that point, the interrupt routine
exits thinking it didn't process any interrupts, and yields a stray
interrupt.

  I was thinking about trying to add something like:

	ret = bus_space_read_2(iot, ioh, ELINK_STATUS) & S_INTR_LATCH;

just before the for (;;) loop.  This should result in a non-zero return
when only the S_INTR_LATCH bit is set.

--
Michael L. Hitch			mhitch@montana.edu
Computer Consultant
Information Technology Center
Montana State University	Bozeman, MT	USA