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