diff options
author | wpaul <wpaul@FreeBSD.org> | 1999-07-07 21:49:14 +0000 |
---|---|---|
committer | wpaul <wpaul@FreeBSD.org> | 1999-07-07 21:49:14 +0000 |
commit | f257de50c18b35168dfa9428efb4162d4676bb4b (patch) | |
tree | 780837ca3160ce811eac87a0d905f8447cc7d483 /sys/pci/if_xl.c | |
parent | dfaa48d6e021eb0c57a315d8f98552ab8ec7927b (diff) | |
download | FreeBSD-src-f257de50c18b35168dfa9428efb4162d4676bb4b.zip FreeBSD-src-f257de50c18b35168dfa9428efb4162d4676bb4b.tar.gz |
Fix a potential race condition that can occur in xl_start(). If the NIC
clears out the transmit queue and zeroes the downlist pointer register,
but xl_txeof() isn't called before xl_start() tries to queue more packets,
xl_start() will think that the DMA is still in progress and not update
the downlist register again, thus causing packets to sit in the transmit
queue forever.
Patch provided by: Russell T Hunt <alaric@MIT.EDU>
Diffstat (limited to 'sys/pci/if_xl.c')
-rw-r--r-- | sys/pci/if_xl.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/sys/pci/if_xl.c b/sys/pci/if_xl.c index e334e43..4a05ffe 100644 --- a/sys/pci/if_xl.c +++ b/sys/pci/if_xl.c @@ -29,7 +29,7 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. * - * $Id: if_xl.c,v 1.41 1999/07/02 04:17:16 peter Exp $ + * $Id: if_xl.c,v 1.42 1999/07/06 19:23:32 des Exp $ */ /* @@ -160,7 +160,7 @@ #if !defined(lint) static const char rcsid[] = - "$Id: if_xl.c,v 1.41 1999/07/02 04:17:16 peter Exp $"; + "$Id: if_xl.c,v 1.42 1999/07/06 19:23:32 des Exp $"; #endif /* @@ -2423,8 +2423,10 @@ static void xl_start(ifp) } else { sc->xl_cdata.xl_tx_head = start_tx; sc->xl_cdata.xl_tx_tail = cur_tx; - CSR_WRITE_4(sc, XL_DOWNLIST_PTR, vtophys(start_tx->xl_ptr)); } + if (!CSR_READ_4(sc, XL_DOWNLIST_PTR)) + CSR_WRITE_4(sc, XL_DOWNLIST_PTR, vtophys(start_tx->xl_ptr)); + CSR_WRITE_2(sc, XL_COMMAND, XL_CMD_DOWN_UNSTALL); XL_SEL_WIN(7); |