Commit d31a36a6 authored by Felix Fietkau's avatar Felix Fietkau Committed by John W. Linville

ath9k: reduce baseband hang detection false positive rate

Check if the baseband state remains stable, and add a small delay
between register reads.
Signed-off-by: default avatarFelix Fietkau <nbd@openwrt.org>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 558ff225
...@@ -1534,7 +1534,7 @@ EXPORT_SYMBOL(ath9k_hw_check_nav); ...@@ -1534,7 +1534,7 @@ EXPORT_SYMBOL(ath9k_hw_check_nav);
bool ath9k_hw_check_alive(struct ath_hw *ah) bool ath9k_hw_check_alive(struct ath_hw *ah)
{ {
int count = 50; int count = 50;
u32 reg; u32 reg, last_val;
if (AR_SREV_9300(ah)) if (AR_SREV_9300(ah))
return !ath9k_hw_detect_mac_hang(ah); return !ath9k_hw_detect_mac_hang(ah);
...@@ -1542,9 +1542,13 @@ bool ath9k_hw_check_alive(struct ath_hw *ah) ...@@ -1542,9 +1542,13 @@ bool ath9k_hw_check_alive(struct ath_hw *ah)
if (AR_SREV_9285_12_OR_LATER(ah)) if (AR_SREV_9285_12_OR_LATER(ah))
return true; return true;
last_val = REG_READ(ah, AR_OBS_BUS_1);
do { do {
reg = REG_READ(ah, AR_OBS_BUS_1); reg = REG_READ(ah, AR_OBS_BUS_1);
if (reg != last_val)
return true;
last_val = reg;
if ((reg & 0x7E7FFFEF) == 0x00702400) if ((reg & 0x7E7FFFEF) == 0x00702400)
continue; continue;
...@@ -1556,6 +1560,8 @@ bool ath9k_hw_check_alive(struct ath_hw *ah) ...@@ -1556,6 +1560,8 @@ bool ath9k_hw_check_alive(struct ath_hw *ah)
default: default:
return true; return true;
} }
udelay(1);
} while (count-- > 0); } while (count-- > 0);
return false; return false;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment