aboutsummaryrefslogtreecommitdiffstats
path: root/package
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2010-11-03 14:56:05 +0000
committerFelix Fietkau <nbd@openwrt.org>2010-11-03 14:56:05 +0000
commitf75ac90b695da2226a25c47d30156983df87ec7b (patch)
tree0bfe4b1d6d8649b156ad72cbb8ebd243e6e98789 /package
parent8bab3639b3053479badcb91cce12d634f248b906 (diff)
downloadupstream-f75ac90b695da2226a25c47d30156983df87ec7b.tar.gz
upstream-f75ac90b695da2226a25c47d30156983df87ec7b.tar.bz2
upstream-f75ac90b695da2226a25c47d30156983df87ec7b.zip
ath9k: fix cycle counter tracking
SVN-Revision: 23824
Diffstat (limited to 'package')
-rw-r--r--package/mac80211/patches/590-ath9k_fix_cycle_counter_ps.patch33
1 files changed, 33 insertions, 0 deletions
diff --git a/package/mac80211/patches/590-ath9k_fix_cycle_counter_ps.patch b/package/mac80211/patches/590-ath9k_fix_cycle_counter_ps.patch
new file mode 100644
index 0000000000..4ee5f7359e
--- /dev/null
+++ b/package/mac80211/patches/590-ath9k_fix_cycle_counter_ps.patch
@@ -0,0 +1,33 @@
+--- 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 *s
+ {
+ struct ath_common *common = ath9k_hw_common(sc->sc_ah);
+ unsigned long flags;
++ enum ath9k_power_mode power_mode;
+
+ spin_lock_irqsave(&sc->sc_pm_lock, flags);
+ if (++sc->ps_usecount != 1)
+ goto unlock;
+
++ power_mode = sc->sc_ah->power_mode;
+ ath9k_hw_setpower(sc->sc_ah, ATH9K_PM_AWAKE);
+
+ /*
+@@ -106,10 +108,12 @@ void ath9k_ps_wakeup(struct ath_softc *s
+ * useful data. Better clear them now so that they don't mess up
+ * survey data results.
+ */
+- spin_lock(&common->cc_lock);
+- ath_hw_cycle_counters_update(common);
+- memset(&common->cc_survey, 0, sizeof(common->cc_survey));
+- spin_unlock(&common->cc_lock);
++ if (power_mode != ATH9K_PM_AWAKE) {
++ spin_lock(&common->cc_lock);
++ ath_hw_cycle_counters_update(common);
++ memset(&common->cc_survey, 0, sizeof(common->cc_survey));
++ spin_unlock(&common->cc_lock);
++ }
+
+ unlock:
+ spin_unlock_irqrestore(&sc->sc_pm_lock, flags);