Module Name:    src
Committed By:   jmcneill
Date:           Mon Nov 28 00:30:17 UTC 2011

Modified Files:
        src/sys/dev/ic: ath.c
        src/sys/external/isc/atheros_hal/dist/ar5416: ar5416_interrupts.c

Log Message:
SVN r220966 from FreeBSD:

Fix a corner-case of interrupt handling which resulted in potentially
spurious (and fatal) interrupt errors.


To generate a diff of this commit:
cvs rdiff -u -r1.112 -r1.113 src/sys/dev/ic/ath.c
cvs rdiff -u -r1.2 -r1.3 \
    src/sys/external/isc/atheros_hal/dist/ar5416/ar5416_interrupts.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/ic/ath.c
diff -u src/sys/dev/ic/ath.c:1.112 src/sys/dev/ic/ath.c:1.113
--- src/sys/dev/ic/ath.c:1.112	Fri Oct  7 16:58:11 2011
+++ src/sys/dev/ic/ath.c	Mon Nov 28 00:30:17 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: ath.c,v 1.112 2011/10/07 16:58:11 dyoung Exp $	*/
+/*	$NetBSD: ath.c,v 1.113 2011/11/28 00:30:17 jmcneill Exp $	*/
 
 /*-
  * Copyright (c) 2002-2005 Sam Leffler, Errno Consulting
@@ -41,7 +41,7 @@
 __FBSDID("$FreeBSD: src/sys/dev/ath/if_ath.c,v 1.104 2005/09/16 10:09:23 ru Exp $");
 #endif
 #ifdef __NetBSD__
-__KERNEL_RCSID(0, "$NetBSD: ath.c,v 1.112 2011/10/07 16:58:11 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ath.c,v 1.113 2011/11/28 00:30:17 jmcneill Exp $");
 #endif
 
 /*
@@ -740,7 +740,7 @@ ath_intr(void *arg)
 	struct ath_softc *sc = arg;
 	struct ifnet *ifp = &sc->sc_if;
 	struct ath_hal *ah = sc->sc_ah;
-	HAL_INT status;
+	HAL_INT status = 0;
 
 	if (!device_activation(sc->sc_dev, DEVACT_LEVEL_DRIVER)) {
 		/*

Index: src/sys/external/isc/atheros_hal/dist/ar5416/ar5416_interrupts.c
diff -u src/sys/external/isc/atheros_hal/dist/ar5416/ar5416_interrupts.c:1.2 src/sys/external/isc/atheros_hal/dist/ar5416/ar5416_interrupts.c:1.3
--- src/sys/external/isc/atheros_hal/dist/ar5416/ar5416_interrupts.c:1.2	Mon Mar  7 11:25:44 2011
+++ src/sys/external/isc/atheros_hal/dist/ar5416/ar5416_interrupts.c	Mon Nov 28 00:30:17 2011
@@ -14,7 +14,7 @@
  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  *
- * $Id: ar5416_interrupts.c,v 1.2 2011/03/07 11:25:44 cegger Exp $
+ * $Id: ar5416_interrupts.c,v 1.3 2011/11/28 00:30:17 jmcneill Exp $
  */
 #include "opt_ah.h"
 
@@ -55,6 +55,8 @@ ar5416IsInterruptPending(struct ath_hal 
  * values.  The value returned is mapped to abstract the hw-specific bit
  * locations in the Interrupt Status Register.
  *
+ * (*masked) is cleared on initial call.
+ *
  * Returns: A hardware-abstracted bitmap of all non-masked-out
  *          interrupts pending, as well as an unmasked value
  */
@@ -73,10 +75,9 @@ ar5416GetPendingInterrupts(struct ath_ha
 		isr = 0;
 	sync_cause = OS_REG_READ(ah, AR_INTR_SYNC_CAUSE);
 	sync_cause &= AR_INTR_SYNC_DEFAULT;
-	if (isr == 0 && sync_cause == 0) {
-		*masked = 0;
+	*masked = 0;
+	if (isr == 0 && sync_cause == 0)
 		return AH_FALSE;
-	}
 
 	if (isr != 0) {
 		struct ath_hal_5212 *ahp = AH5212(ah);

Reply via email to