1 --- a/drivers/net/wireless/ath/ath9k/main.c
2 +++ b/drivers/net/wireless/ath/ath9k/main.c
3 @@ -324,7 +324,6 @@ static void ath_paprd_activate(struct at
4 if (!caldata || !caldata->paprd_done)
8 ar9003_paprd_enable(ah, false);
9 for (chain = 0; chain < AR9300_MAX_CHAINS; chain++) {
10 if (!(common->tx_chainmask & BIT(chain)))
11 @@ -334,7 +333,6 @@ static void ath_paprd_activate(struct at
14 ar9003_paprd_enable(ah, true);
15 - ath9k_ps_restore(sc);
18 static bool ath_paprd_send_frame(struct ath_softc *sc, struct sk_buff *skb, int chain)
19 @@ -554,8 +552,11 @@ set_timer:
20 if ((sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_PAPRD) && ah->caldata) {
21 if (!ah->caldata->paprd_done)
22 ieee80211_queue_work(sc->hw, &sc->paprd_work);
23 - else if (!ah->paprd_table_write_done)
24 + else if (!ah->paprd_table_write_done) {
25 + ath9k_ps_wakeup(sc);
26 ath_paprd_activate(sc);
27 + ath9k_ps_restore(sc);
32 @@ -1376,7 +1377,6 @@ static void ath9k_calculate_summary_stat
34 ath9k_calculate_iter_data(hw, vif, &iter_data);
36 - ath9k_ps_wakeup(sc);
38 memcpy(common->bssidmask, iter_data.mask, ETH_ALEN);
39 ath_hw_setbssidmask(common);
40 @@ -1411,7 +1411,6 @@ static void ath9k_calculate_summary_stat
43 ath9k_hw_set_interrupts(ah, ah->imask);
44 - ath9k_ps_restore(sc);
47 if ((iter_data.naps + iter_data.nadhocs) > 0) {
48 @@ -1457,6 +1456,7 @@ static int ath9k_add_interface(struct ie
49 struct ath_vif *avp = (void *)vif->drv_priv;
52 + ath9k_ps_wakeup(sc);
53 mutex_lock(&sc->mutex);
56 @@ -1503,6 +1503,7 @@ static int ath9k_add_interface(struct ie
57 ath9k_do_vif_add_setup(hw, vif);
59 mutex_unlock(&sc->mutex);
60 + ath9k_ps_restore(sc);
64 @@ -1517,6 +1518,7 @@ static int ath9k_change_interface(struct
66 ath_dbg(common, ATH_DBG_CONFIG, "Change Interface\n");
67 mutex_lock(&sc->mutex);
68 + ath9k_ps_wakeup(sc);
70 /* See if new interface type is valid. */
71 if ((new_type == NL80211_IFTYPE_ADHOC) &&
72 @@ -1546,6 +1548,7 @@ static int ath9k_change_interface(struct
74 ath9k_do_vif_add_setup(hw, vif);
76 + ath9k_ps_restore(sc);
77 mutex_unlock(&sc->mutex);
80 @@ -1558,6 +1561,7 @@ static void ath9k_remove_interface(struc
82 ath_dbg(common, ATH_DBG_CONFIG, "Detach Interface\n");
84 + ath9k_ps_wakeup(sc);
85 mutex_lock(&sc->mutex);
88 @@ -1569,6 +1573,7 @@ static void ath9k_remove_interface(struc
89 ath9k_calculate_summary_state(hw, NULL);
91 mutex_unlock(&sc->mutex);
92 + ath9k_ps_restore(sc);
95 static void ath9k_enable_ps(struct ath_softc *sc)
96 @@ -1830,6 +1835,7 @@ static int ath9k_conf_tx(struct ieee8021
98 txq = sc->tx.txq_map[queue];
100 + ath9k_ps_wakeup(sc);
101 mutex_lock(&sc->mutex);
103 memset(&qi, 0, sizeof(struct ath9k_tx_queue_info));
104 @@ -1853,6 +1859,7 @@ static int ath9k_conf_tx(struct ieee8021
105 ath_beaconq_config(sc);
107 mutex_unlock(&sc->mutex);
108 + ath9k_ps_restore(sc);
112 @@ -1929,6 +1936,7 @@ static void ath9k_bss_info_changed(struc
116 + ath9k_ps_wakeup(sc);
117 mutex_lock(&sc->mutex);
119 if (changed & BSS_CHANGED_BSSID) {
120 @@ -2029,6 +2037,7 @@ static void ath9k_bss_info_changed(struc
123 mutex_unlock(&sc->mutex);
124 + ath9k_ps_restore(sc);
127 static u64 ath9k_get_tsf(struct ieee80211_hw *hw)