sunxi: improve A20 Lime2 upload speed
[openwrt/staging/lynxis.git] / package / kernel / mac80211 / patches / 315-ath9k_hw-check-if-the-chip-failed-to-wake-up.patch
1 From: Felix Fietkau <nbd@nbd.name>
2 Date: Wed, 25 Jan 2017 12:58:17 +0100
3 Subject: [PATCH] ath9k_hw: check if the chip failed to wake up
4
5 In an RFC patch, Sven Eckelmann and Simon Wunderlich reported:
6
7 "QCA 802.11n chips (especially AR9330/AR9340) sometimes end up in a
8 state in which a read of AR_CFG always returns 0xdeadbeef.
9 This should not happen when when the power_mode of the device is
10 ATH9K_PM_AWAKE."
11
12 Include the check for the default register state in the existing MAC
13 hang check.
14
15 Signed-off-by: Felix Fietkau <nbd@nbd.name>
16 ---
17
18 --- a/drivers/net/wireless/ath/ath9k/hw.c
19 +++ b/drivers/net/wireless/ath/ath9k/hw.c
20 @@ -1624,6 +1624,10 @@ bool ath9k_hw_check_alive(struct ath_hw
21 int count = 50;
22 u32 reg, last_val;
23
24 + /* Check if chip failed to wake up */
25 + if (REG_READ(ah, AR_CFG) == 0xdeadbeef)
26 + return false;
27 +
28 if (AR_SREV_9300(ah))
29 return !ath9k_hw_detect_mac_hang(ah);
30