提交 96f372c9 编写于 作者: F Felix Fietkau 提交者: John W. Linville

ath9k: fix missing ath9k_ps_wakeup/ath9k_ps_restore calls

These missing chip wakeups mainly cause crashes on AR5416 cards in MIPS
boards, but have also been reported to cause radio stability issues on
AR9285.
Signed-off-by: NFelix Fietkau <nbd@openwrt.org>
Cc: stable@kernel.org
Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
上级 bd39a274
...@@ -1376,7 +1376,6 @@ static void ath9k_calculate_summary_state(struct ieee80211_hw *hw, ...@@ -1376,7 +1376,6 @@ static void ath9k_calculate_summary_state(struct ieee80211_hw *hw,
ath9k_calculate_iter_data(hw, vif, &iter_data); ath9k_calculate_iter_data(hw, vif, &iter_data);
ath9k_ps_wakeup(sc);
/* Set BSSID mask. */ /* Set BSSID mask. */
memcpy(common->bssidmask, iter_data.mask, ETH_ALEN); memcpy(common->bssidmask, iter_data.mask, ETH_ALEN);
ath_hw_setbssidmask(common); ath_hw_setbssidmask(common);
...@@ -1411,7 +1410,6 @@ static void ath9k_calculate_summary_state(struct ieee80211_hw *hw, ...@@ -1411,7 +1410,6 @@ static void ath9k_calculate_summary_state(struct ieee80211_hw *hw,
} }
ath9k_hw_set_interrupts(ah, ah->imask); ath9k_hw_set_interrupts(ah, ah->imask);
ath9k_ps_restore(sc);
/* Set up ANI */ /* Set up ANI */
if ((iter_data.naps + iter_data.nadhocs) > 0) { if ((iter_data.naps + iter_data.nadhocs) > 0) {
...@@ -1457,6 +1455,7 @@ static int ath9k_add_interface(struct ieee80211_hw *hw, ...@@ -1457,6 +1455,7 @@ static int ath9k_add_interface(struct ieee80211_hw *hw,
struct ath_vif *avp = (void *)vif->drv_priv; struct ath_vif *avp = (void *)vif->drv_priv;
int ret = 0; int ret = 0;
ath9k_ps_wakeup(sc);
mutex_lock(&sc->mutex); mutex_lock(&sc->mutex);
switch (vif->type) { switch (vif->type) {
...@@ -1503,6 +1502,7 @@ static int ath9k_add_interface(struct ieee80211_hw *hw, ...@@ -1503,6 +1502,7 @@ static int ath9k_add_interface(struct ieee80211_hw *hw,
ath9k_do_vif_add_setup(hw, vif); ath9k_do_vif_add_setup(hw, vif);
out: out:
mutex_unlock(&sc->mutex); mutex_unlock(&sc->mutex);
ath9k_ps_restore(sc);
return ret; return ret;
} }
...@@ -1517,6 +1517,7 @@ static int ath9k_change_interface(struct ieee80211_hw *hw, ...@@ -1517,6 +1517,7 @@ static int ath9k_change_interface(struct ieee80211_hw *hw,
ath_dbg(common, ATH_DBG_CONFIG, "Change Interface\n"); ath_dbg(common, ATH_DBG_CONFIG, "Change Interface\n");
mutex_lock(&sc->mutex); mutex_lock(&sc->mutex);
ath9k_ps_wakeup(sc);
/* See if new interface type is valid. */ /* See if new interface type is valid. */
if ((new_type == NL80211_IFTYPE_ADHOC) && if ((new_type == NL80211_IFTYPE_ADHOC) &&
...@@ -1546,6 +1547,7 @@ static int ath9k_change_interface(struct ieee80211_hw *hw, ...@@ -1546,6 +1547,7 @@ static int ath9k_change_interface(struct ieee80211_hw *hw,
ath9k_do_vif_add_setup(hw, vif); ath9k_do_vif_add_setup(hw, vif);
out: out:
ath9k_ps_restore(sc);
mutex_unlock(&sc->mutex); mutex_unlock(&sc->mutex);
return ret; return ret;
} }
...@@ -1558,6 +1560,7 @@ static void ath9k_remove_interface(struct ieee80211_hw *hw, ...@@ -1558,6 +1560,7 @@ static void ath9k_remove_interface(struct ieee80211_hw *hw,
ath_dbg(common, ATH_DBG_CONFIG, "Detach Interface\n"); ath_dbg(common, ATH_DBG_CONFIG, "Detach Interface\n");
ath9k_ps_wakeup(sc);
mutex_lock(&sc->mutex); mutex_lock(&sc->mutex);
sc->nvifs--; sc->nvifs--;
...@@ -1569,6 +1572,7 @@ static void ath9k_remove_interface(struct ieee80211_hw *hw, ...@@ -1569,6 +1572,7 @@ static void ath9k_remove_interface(struct ieee80211_hw *hw,
ath9k_calculate_summary_state(hw, NULL); ath9k_calculate_summary_state(hw, NULL);
mutex_unlock(&sc->mutex); mutex_unlock(&sc->mutex);
ath9k_ps_restore(sc);
} }
static void ath9k_enable_ps(struct ath_softc *sc) static void ath9k_enable_ps(struct ath_softc *sc)
...@@ -1809,6 +1813,7 @@ static int ath9k_conf_tx(struct ieee80211_hw *hw, u16 queue, ...@@ -1809,6 +1813,7 @@ static int ath9k_conf_tx(struct ieee80211_hw *hw, u16 queue,
txq = sc->tx.txq_map[queue]; txq = sc->tx.txq_map[queue];
ath9k_ps_wakeup(sc);
mutex_lock(&sc->mutex); mutex_lock(&sc->mutex);
memset(&qi, 0, sizeof(struct ath9k_tx_queue_info)); memset(&qi, 0, sizeof(struct ath9k_tx_queue_info));
...@@ -1832,6 +1837,7 @@ static int ath9k_conf_tx(struct ieee80211_hw *hw, u16 queue, ...@@ -1832,6 +1837,7 @@ static int ath9k_conf_tx(struct ieee80211_hw *hw, u16 queue,
ath_beaconq_config(sc); ath_beaconq_config(sc);
mutex_unlock(&sc->mutex); mutex_unlock(&sc->mutex);
ath9k_ps_restore(sc);
return ret; return ret;
} }
...@@ -1894,6 +1900,7 @@ static void ath9k_bss_info_changed(struct ieee80211_hw *hw, ...@@ -1894,6 +1900,7 @@ static void ath9k_bss_info_changed(struct ieee80211_hw *hw,
int slottime; int slottime;
int error; int error;
ath9k_ps_wakeup(sc);
mutex_lock(&sc->mutex); mutex_lock(&sc->mutex);
if (changed & BSS_CHANGED_BSSID) { if (changed & BSS_CHANGED_BSSID) {
...@@ -1994,6 +2001,7 @@ static void ath9k_bss_info_changed(struct ieee80211_hw *hw, ...@@ -1994,6 +2001,7 @@ static void ath9k_bss_info_changed(struct ieee80211_hw *hw,
} }
mutex_unlock(&sc->mutex); mutex_unlock(&sc->mutex);
ath9k_ps_restore(sc);
} }
static u64 ath9k_get_tsf(struct ieee80211_hw *hw) static u64 ath9k_get_tsf(struct ieee80211_hw *hw)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册