svn commit: r247572 - stable/9/sys/dev/oce

Josh Paetzel jpaetzel at FreeBSD.org
Fri Mar 1 20:33:36 UTC 2013


Author: jpaetzel
Date: Fri Mar  1 20:33:35 2013
New Revision: 247572
URL: http://svnweb.freebsd.org/changeset/base/247572

Log:
  MFC 246799:
  
  Resolve issue that caused WITNESS to report LORs.

Modified:
  stable/9/sys/dev/oce/oce_if.c
  stable/9/sys/dev/oce/oce_if.h
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/dev/   (props changed)

Modified: stable/9/sys/dev/oce/oce_if.c
==============================================================================
--- stable/9/sys/dev/oce/oce_if.c	Fri Mar  1 20:16:06 2013	(r247571)
+++ stable/9/sys/dev/oce/oce_if.c	Fri Mar  1 20:33:35 2013	(r247572)
@@ -1856,6 +1856,9 @@ oce_local_timer(void *arg)
 }
 
 
+/* NOTE : This should only be called holding
+ *        DEVICE_LOCK.
+*/
 static void
 oce_if_deactivate(POCE_SOFTC sc)
 {
@@ -1885,11 +1888,17 @@ oce_if_deactivate(POCE_SOFTC sc)
 	/* Stop intrs and finish any bottom halves pending */
 	oce_hw_intr_disable(sc);
 
+    /* Since taskqueue_drain takes a Giant Lock, We should not acquire
+       any other lock. So unlock device lock and require after
+       completing taskqueue_drain.
+    */
+    UNLOCK(&sc->dev_lock);
 	for (i = 0; i < sc->intr_count; i++) {
 		if (sc->intrs[i].tq != NULL) {
 			taskqueue_drain(sc->intrs[i].tq, &sc->intrs[i].task);
 		}
 	}
+    LOCK(&sc->dev_lock);
 
 	/* Delete RX queue in card with flush param */
 	oce_stop_rx(sc);

Modified: stable/9/sys/dev/oce/oce_if.h
==============================================================================
--- stable/9/sys/dev/oce/oce_if.h	Fri Mar  1 20:16:06 2013	(r247571)
+++ stable/9/sys/dev/oce/oce_if.h	Fri Mar  1 20:33:35 2013	(r247572)
@@ -491,7 +491,7 @@ struct oce_lock {
 #define LOCK_CREATE(lock, desc) 		{ \
 	strncpy((lock)->name, (desc), MAX_LOCK_DESC_LEN); \
 	(lock)->name[MAX_LOCK_DESC_LEN] = '\0'; \
-	mtx_init(&(lock)->mutex, (lock)->name, MTX_NETWORK_LOCK, MTX_DEF); \
+	mtx_init(&(lock)->mutex, (lock)->name, NULL, MTX_DEF); \
 }
 #define LOCK_DESTROY(lock) 			\
 		if (mtx_initialized(&(lock)->mutex))\


More information about the svn-src-stable-9 mailing list