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: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
This commit is contained in:
parent
558ff225de
commit
d31a36a6d8
1 changed files with 7 additions and 1 deletions
|
@ -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)
|
||||||
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)
|
||||||
default:
|
default:
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
udelay(1);
|
||||||
} while (count-- > 0);
|
} while (count-- > 0);
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
|
Loading…
Add table
Reference in a new issue