1
0

301-ath9k-force-rx_clear-when-disabling-rx.patch 1.1 KB

1234567891011121314151617181920212223242526272829303132333435
  1. From: Felix Fietkau <nbd@openwrt.org>
  2. Date: Sun, 7 Jun 2015 13:53:35 +0200
  3. Subject: [PATCH] ath9k: force rx_clear when disabling rx
  4. This makes stopping Rx more reliable and should reduce the frequency of
  5. Rx related DMA stop warnings. Don't use rx_clear in TX99 mode.
  6. Cc: stable@vger.kernel.org
  7. Signed-off-by: Felix Fietkau <nbd@nbd.name>
  8. Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>
  9. ---
  10. --- a/drivers/net/wireless/ath/ath9k/mac.c
  11. +++ b/drivers/net/wireless/ath/ath9k/mac.c
  12. @@ -677,13 +677,18 @@ void ath9k_hw_startpcureceive(struct ath
  13. ath9k_ani_reset(ah, is_scanning);
  14. - REG_CLR_BIT(ah, AR_DIAG_SW, (AR_DIAG_RX_DIS | AR_DIAG_RX_ABORT));
  15. + REG_CLR_BIT(ah, AR_DIAG_SW,
  16. + AR_DIAG_RX_DIS | AR_DIAG_RX_ABORT | AR_DIAG_FORCE_RX_CLEAR);
  17. }
  18. EXPORT_SYMBOL(ath9k_hw_startpcureceive);
  19. void ath9k_hw_abortpcurecv(struct ath_hw *ah)
  20. {
  21. - REG_SET_BIT(ah, AR_DIAG_SW, AR_DIAG_RX_ABORT | AR_DIAG_RX_DIS);
  22. + u32 reg = AR_DIAG_RX_DIS | AR_DIAG_RX_ABORT;
  23. +
  24. + if (!config_enabled(CPTCFG_ATH9K_TX99))
  25. + reg |= AR_DIAG_FORCE_RX_CLEAR;
  26. + REG_SET_BIT(ah, AR_DIAG_SW, reg);
  27. ath9k_hw_disable_mib_counters(ah);
  28. }