rtl8139 pci mem freeze (more info)

Donald Becker becker@thinkpad.green.net
Sat Oct 2 20:09:31 1999


On Sat, 2 Oct 1999, Daniel Kobras wrote:
> > Does reading any register avoid the hang, or must it be RxBufPtr?
> 
> [Note that reverting the above change doesn't always cause a hang,
> sometimes I only get tons of Rx errors, sometimes it hangs. But I have
> _never_ seen any hang with the above change applied.]
> 
> Any delay will suffice, it doesn't have to be a read[bwl]. And I think
> I've found the reason: The Buffer Empty flag in ChipCmd occasionally isn't
> updated fast enough after writing out the new RxBufPtr, so we run an Rx
> cycle without data pending. That does explain the errors but still I don't
> see why this would lock my machine. 
...
> The udelay() in the interrupt path of course bothers me a lot and from my
> testing it looks like a much shorter delay would suffice but I don't know
> of a portable way to do that. (Is there sort of an ndelay() available?)

I never use udelay() if I can avoid it.  I much prefer using a PCI bus read.

In part this is because udelay() was once changed+broken (it runs at
different speed depending on cache alignment) and I got the bug reports for
the resulting problems.

A PCI bus read should also flush the write buffer and cycle any circuitry
associated with the chip's bus arbitration.

It might be possible that we can compare RxBufPtr with RxBufAddr, and avoid
any interaction with the ChipCmd register.  I'll check on that the next time
I have a rtl8139 card in the test machine.

Donald Becker
USRA-CESDIS, becker@cesdis.gsfc.nasa.gov
Scyld Computing Corporation, becker@tidalwave.net

 | To unsubscribe, send mail to Majordomo@cesdis.gsfc.nasa.gov, and within the
 |  body of the mail, include only the text:
 |   unsubscribe this-list-name youraddress@wherever.org
 | You will be unsubscribed as speedily as possible.