ath9k: reorganize patches
[openwrt/staging/chunkeey.git] / package / kernel / mac80211 / patches / 541-ath9k_rx_dma_stop_check.patch
diff --git a/package/kernel/mac80211/patches/541-ath9k_rx_dma_stop_check.patch b/package/kernel/mac80211/patches/541-ath9k_rx_dma_stop_check.patch
new file mode 100644 (file)
index 0000000..5d063c7
--- /dev/null
@@ -0,0 +1,28 @@
+--- a/drivers/net/wireless/ath/ath9k/mac.c
++++ b/drivers/net/wireless/ath/ath9k/mac.c
+@@ -705,7 +705,7 @@ bool ath9k_hw_stopdmarecv(struct ath_hw 
+ {
+ #define AH_RX_STOP_DMA_TIMEOUT 10000   /* usec */
+       struct ath_common *common = ath9k_hw_common(ah);
+-      u32 mac_status, last_mac_status = 0;
++      u32 mac_status = 0, last_mac_status = 0;
+       int i;
+       /* Enable access to the DMA observation bus */
+@@ -735,6 +735,16 @@ bool ath9k_hw_stopdmarecv(struct ath_hw 
+       }
+       if (i == 0) {
++              if (!AR_SREV_9300_20_OR_LATER(ah) &&
++                  (mac_status & 0x700) == 0) {
++                      /*
++                       * DMA is idle but the MAC is still stuck
++                       * processing events
++                       */
++                      *reset = true;
++                      return true;
++              }
++
+               ath_err(common,
+                       "DMA failed to stop in %d ms AR_CR=0x%08x AR_DIAG_SW=0x%08x DMADBG_7=0x%08x\n",
+                       AH_RX_STOP_DMA_TIMEOUT / 1000,