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