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
6a91557
index 275205ab5f15..bb842623bdf6 100644
Josh Boyer 27e48a6
--- a/drivers/net/wireless/ath/ath9k/mac.c
Josh Boyer 27e48a6
+++ b/drivers/net/wireless/ath/ath9k/mac.c
6a91557
@@ -700,7 +700,7 @@ bool ath9k_hw_stopdmarecv(struct ath_hw *ah, bool *reset)
Josh Boyer 27e48a6
 {
Josh Boyer 27e48a6
 #define AH_RX_STOP_DMA_TIMEOUT 10000   /* usec */
Josh Boyer 27e48a6
 	struct ath_common *common = ath9k_hw_common(ah);
Josh Boyer 27e48a6
-	u32 mac_status, last_mac_status = 0;
Josh Boyer 27e48a6
+	u32 mac_status = 0, last_mac_status = 0;
Josh Boyer 27e48a6
 	int i;
Josh Boyer 27e48a6
 
Josh Boyer 27e48a6
 	/* Enable access to the DMA observation bus */
6a91557
@@ -730,6 +730,16 @@ bool ath9k_hw_stopdmarecv(struct ath_hw *ah, bool *reset)
Josh Boyer 27e48a6
 	}
Josh Boyer 27e48a6
 
Josh Boyer 27e48a6
 	if (i == 0) {
Josh Boyer 27e48a6
+		if (!AR_SREV_9300_20_OR_LATER(ah) &&
Josh Boyer 27e48a6
+		    (mac_status & 0x700) == 0) {
Josh Boyer 27e48a6
+			/*
Josh Boyer 27e48a6
+			 * DMA is idle but the MAC is still stuck
Josh Boyer 27e48a6
+			 * processing events
Josh Boyer 27e48a6
+			 */
Josh Boyer 27e48a6
+			*reset = true;
Josh Boyer 27e48a6
+			return true;
Josh Boyer 27e48a6
+		}
Josh Boyer 27e48a6
+
Josh Boyer 27e48a6
 		ath_err(common,
Josh Boyer 27e48a6
 			"DMA failed to stop in %d ms AR_CR=0x%08x AR_DIAG_SW=0x%08x DMADBG_7=0x%08x\n",
Josh Boyer 27e48a6
 			AH_RX_STOP_DMA_TIMEOUT / 1000,
6a91557
-- 
1e63a38
2.1.0
6a91557