diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/wireless/ath/ath9k/main.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c index 09dcdd7882e6..25d3ef4c338e 100644 --- a/drivers/net/wireless/ath/ath9k/main.c +++ b/drivers/net/wireless/ath/ath9k/main.c | |||
@@ -94,11 +94,13 @@ void ath9k_ps_wakeup(struct ath_softc *sc) | |||
94 | { | 94 | { |
95 | struct ath_common *common = ath9k_hw_common(sc->sc_ah); | 95 | struct ath_common *common = ath9k_hw_common(sc->sc_ah); |
96 | unsigned long flags; | 96 | unsigned long flags; |
97 | enum ath9k_power_mode power_mode; | ||
97 | 98 | ||
98 | spin_lock_irqsave(&sc->sc_pm_lock, flags); | 99 | spin_lock_irqsave(&sc->sc_pm_lock, flags); |
99 | if (++sc->ps_usecount != 1) | 100 | if (++sc->ps_usecount != 1) |
100 | goto unlock; | 101 | goto unlock; |
101 | 102 | ||
103 | power_mode = sc->sc_ah->power_mode; | ||
102 | ath9k_hw_setpower(sc->sc_ah, ATH9K_PM_AWAKE); | 104 | ath9k_hw_setpower(sc->sc_ah, ATH9K_PM_AWAKE); |
103 | 105 | ||
104 | /* | 106 | /* |
@@ -106,10 +108,12 @@ void ath9k_ps_wakeup(struct ath_softc *sc) | |||
106 | * useful data. Better clear them now so that they don't mess up | 108 | * useful data. Better clear them now so that they don't mess up |
107 | * survey data results. | 109 | * survey data results. |
108 | */ | 110 | */ |
109 | spin_lock(&common->cc_lock); | 111 | if (power_mode != ATH9K_PM_AWAKE) { |
110 | ath_hw_cycle_counters_update(common); | 112 | spin_lock(&common->cc_lock); |
111 | memset(&common->cc_survey, 0, sizeof(common->cc_survey)); | 113 | ath_hw_cycle_counters_update(common); |
112 | spin_unlock(&common->cc_lock); | 114 | memset(&common->cc_survey, 0, sizeof(common->cc_survey)); |
115 | spin_unlock(&common->cc_lock); | ||
116 | } | ||
113 | 117 | ||
114 | unlock: | 118 | unlock: |
115 | spin_unlock_irqrestore(&sc->sc_pm_lock, flags); | 119 | spin_unlock_irqrestore(&sc->sc_pm_lock, flags); |