orgads / rpms / kernel

Forked from rpms/kernel 3 years ago
Clone
e336be
From: "kernel-team@fedoraproject.org" <kernel-team@fedoraproject.org>
e336be
Date: Wed, 6 Feb 2013 09:57:47 -0500
e336be
Subject: [PATCH] ath9k: rx dma stop check
e336be
e336be
---
e336be
 drivers/net/wireless/ath/ath9k/mac.c | 12 +++++++++++-
e336be
 1 file changed, 11 insertions(+), 1 deletion(-)
e336be
e336be
diff --git a/drivers/net/wireless/ath/ath9k/mac.c b/drivers/net/wireless/ath/ath9k/mac.c
e336be
index bba85d1a6cd1..ebbee8f17130 100644
e336be
--- a/drivers/net/wireless/ath/ath9k/mac.c
e336be
+++ b/drivers/net/wireless/ath/ath9k/mac.c
e336be
@@ -693,7 +693,7 @@ bool ath9k_hw_stopdmarecv(struct ath_hw *ah, bool *reset)
e336be
 {
e336be
 #define AH_RX_STOP_DMA_TIMEOUT 10000   /* usec */
e336be
 	struct ath_common *common = ath9k_hw_common(ah);
e336be
-	u32 mac_status, last_mac_status = 0;
e336be
+	u32 mac_status = 0, last_mac_status = 0;
e336be
 	int i;
e336be
 
e336be
 	/* Enable access to the DMA observation bus */
e336be
@@ -723,6 +723,16 @@ bool ath9k_hw_stopdmarecv(struct ath_hw *ah, bool *reset)
e336be
 	}
e336be
 
e336be
 	if (i == 0) {
e336be
+		if (!AR_SREV_9300_20_OR_LATER(ah) &&
e336be
+		    (mac_status & 0x700) == 0) {
e336be
+			/*
e336be
+			 * DMA is idle but the MAC is still stuck
e336be
+			 * processing events
e336be
+			 */
e336be
+			*reset = true;
e336be
+			return true;
e336be
+		}
e336be
+
e336be
 		ath_err(common,
e336be
 			"DMA failed to stop in %d ms AR_CR=0x%08x AR_DIAG_SW=0x%08x DMADBG_7=0x%08x\n",
e336be
 			AH_RX_STOP_DMA_TIMEOUT / 1000,