o11s / open80211s

open80211s
Other
242 stars 55 forks source link

ath9k_htc: hardware stuck with radio always-on #16

Open mporsch opened 11 years ago

mporsch commented 11 years ago

Issue:

During mesh PS operation power consumption rises to 120mA and stays at that level until ifdown (mesh leave + join does not reset it to normal state) (~55mA is the normal current in PS mode with no activity for TL-WN721)

Hardware issue? Does the hardware expect certain managed-mode specific events (TSF out of range, AP beacon, ...)?

How to reproduce:

The time to failure varies between seconds to 1-2 minutes.

Effect:

No obvious debug output with all ath9k debugs enabled.

Reading AR_RTC_STATUS before and after REG_CLR_BIT(ah, AR_RTC_FORCE_WAKE, AR_RTC_FORCE_WAKE_EN); reveals the following

normal:

[ 301.655141] ath: phy0: AR_RTC_STATUS before: 02 [ 301.661079] ath: phy0: AR_RTC_STATUS after: 04

when being stuck it changes to:

[ 302.677066] ath: phy0: AR_RTC_STATUS before: 02 [ 302.683085] ath: phy0: AR_RTC_STATUS after: 02

To easier follow the status use following debug prints.

diff --git a/drivers/net/wireless/ath/ath9k/hw.c b/drivers/net/wireless/ath/ath9k/hw.c
index e06bcec..c463277 100644
--- a/drivers/net/wireless/ath/ath9k/hw.c
+++ b/drivers/net/wireless/ath/ath9k/hw.c
@@ -2121,6 +2121,9 @@ static void ath9k_set_power_network_sleep(struct ath_hw *ah)
                        udelay(30);
        }

+     if ((REG_READ(ah, AR_RTC_STATUS) & AR_RTC_STATUS_M) == AR_RTC_STATUS_ON)
+             ath_dbg(ath9k_hw_common(ah), PS, "AR_RTC_STATUS stuck\n");
+
        /* Clear Bit 14 of AR_WA after putting chip into Net Sleep mode. */
        if (AR_SREV_9300_20_OR_LATER(ah))
                REG_WRITE(ah, AR_WA, ah->WARegVal & ~AR_WA_D3_L1_DISABLE); 

Already tested: