Introduce two delays in nfe_stop().
authorMatthew Dillon <dillon@dragonflybsd.org>
Thu, 9 Aug 2007 07:24:50 +0000 (07:24 +0000)
committerMatthew Dillon <dillon@dragonflybsd.org>
Thu, 9 Aug 2007 07:24:50 +0000 (07:24 +0000)
commitd1daf8af91ab654ac8f5e78d0874506e98ea1820
tree81d6cebb1d65b12c1a6137dce62901724779f800
parent751890abf91e5ac91a57dd6e64724d78988e5fea
Introduce two delays in nfe_stop().

The first seems to fix or greatly reduce instances of watchdog failures.
I theorize that a TX KICK occuring just prior to a nfe_stop() is confusing
the microcontroller due to the polled nature of the rest of the tx/rx control
registers and the (almost certain) hardware aided TX KICK bit.  This
confusion survives the nfe_stop() and nfe_init().  I'll again theorize that
the KICK, which is probably a microcontroller interrupt, is not being reset
and is being handled at some inappropriate point in time in the middle of
nfe_stop() or nfe_init().

The second delay gives the device time to actually stop the DMA engine
before we destroy the ring buffers.  Even if those registers were under
direct hardware control (and I really doubt they are), DMA just doesn't
instantly stop when you tell it to.
sys/dev/netif/nfe/if_nfe.c