Skip to content

Commit

Permalink
ath9k: reduce baseband hang detection false positive rate
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Felix Fietkau authored and John W. Linville committed Feb 25, 2014
1 parent 558ff22 commit d31a36a
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion drivers/net/wireless/ath/ath9k/hw.c
Original file line number Diff line number Diff line change
Expand Up @@ -1534,17 +1534,21 @@ EXPORT_SYMBOL(ath9k_hw_check_nav);
bool ath9k_hw_check_alive(struct ath_hw *ah)
{
int count = 50;
u32 reg;
u32 reg, last_val;

if (AR_SREV_9300(ah))
return !ath9k_hw_detect_mac_hang(ah);

if (AR_SREV_9285_12_OR_LATER(ah))
return true;

last_val = REG_READ(ah, AR_OBS_BUS_1);
do {
reg = REG_READ(ah, AR_OBS_BUS_1);
if (reg != last_val)
return true;

last_val = reg;
if ((reg & 0x7E7FFFEF) == 0x00702400)
continue;

Expand All @@ -1556,6 +1560,8 @@ bool ath9k_hw_check_alive(struct ath_hw *ah)
default:
return true;
}

udelay(1);
} while (count-- > 0);

return false;
Expand Down

0 comments on commit d31a36a

Please sign in to comment.