summaryrefslogtreecommitdiffstats
path: root/sys/dev
diff options
context:
space:
mode:
authormarius <marius@FreeBSD.org>2012-03-24 15:15:34 +0000
committermarius <marius@FreeBSD.org>2012-03-24 15:15:34 +0000
commit760232ce9610daa93d022a5bdd35c8b08461c68d (patch)
tree8a745cbb48d163b60d19e9671c9aa4dc5412c658 /sys/dev
parent1994f885d3a28d7f220a6843465ea8a672012003 (diff)
downloadFreeBSD-src-760232ce9610daa93d022a5bdd35c8b08461c68d.zip
FreeBSD-src-760232ce9610daa93d022a5bdd35c8b08461c68d.tar.gz
Initialize the mutexes used for the NVM and the swflag as MTX_DUPOK in
order to avoid otherwise harmless witness warnings when these are acquired at the same time and due to both using MTX_NETWORK_LOCK as their type. The right fix actually would be to use different, descriptive types for these. However, the latter would require undesirable changes to the shared code base. Another approach would be to just supply NULL as the type, which was deemed as less desirable though as it would cause the unique but cryptic name also to be used for the type and to diverge from the type used by other network device drivers. MFC after: 1 week
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/e1000/e1000_osdep.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/dev/e1000/e1000_osdep.h b/sys/dev/e1000/e1000_osdep.h
index 7eb7bb6..e6d131a 100644
--- a/sys/dev/e1000/e1000_osdep.h
+++ b/sys/dev/e1000/e1000_osdep.h
@@ -84,7 +84,8 @@
/* Mutex used in the shared code */
#define E1000_MUTEX struct mtx
#define E1000_MUTEX_INIT(mutex) mtx_init((mutex), #mutex, \
- MTX_NETWORK_LOCK, MTX_DEF)
+ MTX_NETWORK_LOCK, \
+ MTX_DEF | MTX_DUPOK)
#define E1000_MUTEX_DESTROY(mutex) mtx_destroy(mutex)
#define E1000_MUTEX_LOCK(mutex) mtx_lock(mutex)
#define E1000_MUTEX_TRYLOCK(mutex) mtx_trylock(mutex)
OpenPOWER on IntegriCloud