mac80211: update to version 2015-06-22
[openwrt/svn-archive/archive.git] / package / kernel / mac80211 / patches / 305-ath9k-make-DMA-stop-related-messages-debug-only.patch
1 From: Felix Fietkau <nbd@openwrt.org>
2 Date: Thu, 2 Jul 2015 13:35:05 +0200
3 Subject: [PATCH] ath9k: make DMA stop related messages debug-only
4
5 A long time ago, ath9k had issues during reset where the DMA engine
6 would stay active and could potentially corrupt memory.
7 To debug those issues, the driver would print warnings whenever they
8 occur.
9
10 Nowadays, these issues are gone and the primary cause of these messages
11 is if the MAC is stuck during reset or busy processing a long
12 transmission. This is fairly harmless, yet these messages continue to
13 worry users.
14
15 To reduce the number of bogus bug reports, turn these messages into
16 debug messages and count their occurence in the "reset" debugfs file.
17
18 Signed-off-by: Felix Fietkau <nbd@openwrt.org>
19 ---
20
21 --- a/drivers/net/wireless/ath/ath9k/debug.c
22 +++ b/drivers/net/wireless/ath/ath9k/debug.c
23 @@ -765,6 +765,8 @@ static int read_file_reset(struct seq_fi
24 [RESET_TYPE_BEACON_STUCK] = "Stuck Beacon",
25 [RESET_TYPE_MCI] = "MCI Reset",
26 [RESET_TYPE_CALIBRATION] = "Calibration error",
27 + [RESET_TX_DMA_ERROR] = "Tx DMA stop error",
28 + [RESET_RX_DMA_ERROR] = "Rx DMA stop error",
29 };
30 int i;
31
32 --- a/drivers/net/wireless/ath/ath9k/debug.h
33 +++ b/drivers/net/wireless/ath/ath9k/debug.h
34 @@ -50,6 +50,8 @@ enum ath_reset_type {
35 RESET_TYPE_BEACON_STUCK,
36 RESET_TYPE_MCI,
37 RESET_TYPE_CALIBRATION,
38 + RESET_TX_DMA_ERROR,
39 + RESET_RX_DMA_ERROR,
40 __RESET_TYPE_MAX
41 };
42
43 --- a/drivers/net/wireless/ath/ath9k/recv.c
44 +++ b/drivers/net/wireless/ath/ath9k/recv.c
45 @@ -491,10 +491,9 @@ bool ath_stoprecv(struct ath_softc *sc)
46
47 if (!(ah->ah_flags & AH_UNPLUGGED) &&
48 unlikely(!stopped)) {
49 - ath_err(ath9k_hw_common(sc->sc_ah),
50 - "Could not stop RX, we could be "
51 - "confusing the DMA engine when we start RX up\n");
52 - ATH_DBG_WARN_ON_ONCE(!stopped);
53 + ath_dbg(ath9k_hw_common(sc->sc_ah), RESET,
54 + "Failed to stop Rx DMA\n");
55 + RESET_STAT_INC(sc, RESET_RX_DMA_ERROR);
56 }
57 return stopped && !reset;
58 }
59 --- a/drivers/net/wireless/ath/ath9k/xmit.c
60 +++ b/drivers/net/wireless/ath/ath9k/xmit.c
61 @@ -1883,8 +1883,11 @@ bool ath_drain_all_txq(struct ath_softc
62 npend |= BIT(i);
63 }
64
65 - if (npend)
66 - ath_err(common, "Failed to stop TX DMA, queues=0x%03x!\n", npend);
67 + if (npend) {
68 + RESET_STAT_INC(sc, RESET_TX_DMA_ERROR);
69 + ath_dbg(common, RESET,
70 + "Failed to stop TX DMA, queues=0x%03x!\n", npend);
71 + }
72
73 for (i = 0; i < ATH9K_NUM_TX_QUEUES; i++) {
74 if (!ATH_TXQ_SETUP(sc, i))