summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Belopuhov <mikeb@cvs.openbsd.org>2012-11-08 18:26:18 +0000
committerMike Belopuhov <mikeb@cvs.openbsd.org>2012-11-08 18:26:18 +0000
commit58b194e53e9fbbdd881b66d59bbb7c834d632f19 (patch)
tree440cec3d0fd400d28199eb8631a6904b00d61cdf
parent502a1a9fdcfd80894e8d7c3c83411d7dc005fe6f (diff)
When halting the rx engine wait 1ms after destroying the queue in
firmware then drain the completion queue and only afterwards deal with posted buffers so that the firmware wouldn't decide to DMA something into the freed cluster. Logic from the Linux driver.
-rw-r--r--sys/dev/pci/if_oce.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/dev/pci/if_oce.c b/sys/dev/pci/if_oce.c
index b8909e2c563..c3aa8997b1c 100644
--- a/sys/dev/pci/if_oce.c
+++ b/sys/dev/pci/if_oce.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_oce.c,v 1.46 2012/11/08 17:59:08 mikeb Exp $ */
+/* $OpenBSD: if_oce.c,v 1.47 2012/11/08 18:26:17 mikeb Exp $ */
/*
* Copyright (c) 2012 Mike Belopuhov
@@ -1544,8 +1544,9 @@ oce_stop(struct oce_softc *sc)
oce_drain_eq(eq);
for_all_rq_queues(sc, rq, i) {
oce_destroy_queue(sc, QTYPE_RQ, rq->id);
- oce_free_posted_rxbuf(rq);
+ DELAY(1000);
oce_drain_rq(rq);
+ oce_free_posted_rxbuf(rq);
}
for_all_wq_queues(sc, wq, i)
oce_drain_wq(wq);