Subject: Re: port-i386/4830: NE2000 ethernet board interrupt trouble
To: Jason Thorpe <thorpej@nas.nasa.gov>
From: David Greenman <dg@root.com>
List: netbsd-bugs
Date: 01/16/1998 17:06:02
>On 16 Jan 1998 22:14:19 GMT 
> tron@lyssa.owl.de (Matthias Scheler) wrote:
>
> > I agree that this kind of bugs exist. But reading his bug report I had
> > the impression that his fix was kludge to give his poor overstressed
> > hardware time to recover. The 337 MHz indicates that he's not only
> > overclocking the CPU but the system bus so that any kind of failures
> > of the I/O hardware are a logical consequence. I really would like to
> > know if the bug can be reproduced on a system without overclocked bus
> > speed.
>
>Let me address this, now... say I have an NE2000 in a 533MHz Alpha (quite
>plausible, although stupid :-) ... even though I'm not overclocking the
>hardware, I could still run into this problem simply because the countdown
>loop would expire too quickly.
>
>If a comment in a piece of code says "wait 5ms", the code should take some
>measures to make sure it waits at least that long.

   Unless NetBSD has changed the comment, that is not what I originally said
in the code. The comment said:

        /*
         * Wait for interface to enter stopped state, but limit # of checks to
         * 'n' (about 5ms). It shouldn't even take 5us on modern DS8390's, but
         * just in case it's an old one.
         */


   ...and the code has a check for a bit in a register within the loop. So
unless you're telling me that an Alpha can read a bus register in less than
1 nanosecond (actually, < 200 picoseconds...I believe the recovery time from
reset is 1us), then I don't see how that particular chunk of code could have
anything to do with this unless the loop got optimized away or you have a
very old 8390 chip (rev 'B' or earlier, Circa 1983, which is buggy in a
variety of other ways as well).
   I don't disagree that the loop could use a "DELAY(1)" or something,
however, but let's try to keep things in perspective.

-DG

David Greenman
Core-team/Principal Architect, The FreeBSD Project