ath9k: Check early for HW reset

chan_lock is not required for checking if
we are in the middle of a HW reset, so do it
early. This also removes the small window
where the lock is dropped and reacquired.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
This commit is contained in:
Sujith Manoharan 2014-09-30 14:15:23 +05:30 committed by John W. Linville
parent 4eb3af7c1d
commit 4d9f634b02
1 changed files with 8 additions and 6 deletions

View File

@ -1839,15 +1839,17 @@ void ath_txq_schedule(struct ath_softc *sc, struct ath_txq *txq)
if (txq->mac80211_qnum < 0) if (txq->mac80211_qnum < 0)
return; return;
spin_lock_bh(&sc->chan_lock); if (test_bit(ATH_OP_HW_RESET, &common->op_flags))
ac_list = &sc->cur_chan->acq[txq->mac80211_qnum];
spin_unlock_bh(&sc->chan_lock);
if (test_bit(ATH_OP_HW_RESET, &common->op_flags) ||
list_empty(ac_list))
return; return;
spin_lock_bh(&sc->chan_lock); spin_lock_bh(&sc->chan_lock);
ac_list = &sc->cur_chan->acq[txq->mac80211_qnum];
if (list_empty(ac_list)) {
spin_unlock_bh(&sc->chan_lock);
return;
}
rcu_read_lock(); rcu_read_lock();
last_ac = list_entry(ac_list->prev, struct ath_atx_ac, list); last_ac = list_entry(ac_list->prev, struct ath_atx_ac, list);