Module Name:    src
Committed By:   christos
Date:           Sun Aug 29 07:00:13 UTC 2010

Modified Files:
        src/sys/dev/pci: if_iwn.c

Log Message:
Don't try to hold the mutex if we are disabling the card because we can
be called from an interrupt context. While this is not strictly correct,
we are SoL anyway so this does not matter.


To generate a diff of this commit:
cvs rdiff -u -r1.49 -r1.50 src/sys/dev/pci/if_iwn.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/if_iwn.c
diff -u src/sys/dev/pci/if_iwn.c:1.49 src/sys/dev/pci/if_iwn.c:1.50
--- src/sys/dev/pci/if_iwn.c:1.49	Sat Jul 10 00:09:35 2010
+++ src/sys/dev/pci/if_iwn.c	Sun Aug 29 03:00:13 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_iwn.c,v 1.49 2010/07/10 04:09:35 christos Exp $	*/
+/*	$NetBSD: if_iwn.c,v 1.50 2010/08/29 07:00:13 christos Exp $	*/
 /*	$OpenBSD: if_iwn.c,v 1.96 2010/05/13 09:25:03 damien Exp $	*/
 
 /*-
@@ -22,7 +22,7 @@
  * adapters.
  */
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_iwn.c,v 1.49 2010/07/10 04:09:35 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_iwn.c,v 1.50 2010/08/29 07:00:13 christos Exp $");
 
 #define IWN_USE_RBUF	/* Use local storage for RX */
 #undef IWN_HWCRYPTO	/* XXX does not even compile yet */
@@ -5913,7 +5913,8 @@
 	struct iwn_softc *sc = ifp->if_softc;
 	struct ieee80211com *ic = &sc->sc_ic;
 
-	mutex_enter(&sc->sc_mtx);
+	if (!disable)
+		mutex_enter(&sc->sc_mtx);
 	sc->sc_flags &= ~IWN_FLAG_HW_INITED;
 	ifp->if_timer = sc->sc_tx_timer = 0;
 	ifp->if_flags &= ~(IFF_RUNNING | IFF_OACTIVE);
@@ -5928,7 +5929,8 @@
 	sc->sc_sensor.value_cur = 0;
 	sc->sc_sensor.state = ENVSYS_SINVALID;
 #endif
-	mutex_exit(&sc->sc_mtx);
+	if (!disable)
+		mutex_exit(&sc->sc_mtx);
 }
 
 /*

Reply via email to