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