diff options
author | adrian <adrian@FreeBSD.org> | 2012-06-11 07:06:49 +0000 |
---|---|---|
committer | adrian <adrian@FreeBSD.org> | 2012-06-11 07:06:49 +0000 |
commit | 97dfa39fc4819ada4a5b65c80595654d81435daa (patch) | |
tree | 999daafc72eb1f090e2532ec117cd6e69962a9f9 | |
parent | 0760025f8f88ba2718f5ed6d6f11c64d3e3ea9c2 (diff) | |
download | FreeBSD-src-97dfa39fc4819ada4a5b65c80595654d81435daa.zip FreeBSD-src-97dfa39fc4819ada4a5b65c80595654d81435daa.tar.gz |
Introduce a new lock debug which is specifically for making sure the
_TID_ lock is held.
For now the TID lock is also the TXQ lock. This is just to make sure
that the right TXQ lock is held for the given TID.
-rw-r--r-- | sys/dev/ath/if_ath_tx.c | 5 | ||||
-rw-r--r-- | sys/dev/ath/if_athvar.h | 3 |
2 files changed, 8 insertions, 0 deletions
diff --git a/sys/dev/ath/if_ath_tx.c b/sys/dev/ath/if_ath_tx.c index cb12dca..5607bd6 100644 --- a/sys/dev/ath/if_ath_tx.c +++ b/sys/dev/ath/if_ath_tx.c @@ -2030,6 +2030,7 @@ ath_tx_addto_baw(struct ath_softc *sc, struct ath_node *an, struct ieee80211_tx_ampdu *tap; ATH_TXQ_LOCK_ASSERT(sc->sc_ac2q[tid->ac]); + ATH_TID_LOCK_ASSERT(sc, tid); if (bf->bf_state.bfs_isretried) return; @@ -2102,6 +2103,7 @@ ath_tx_switch_baw_buf(struct ath_softc *sc, struct ath_node *an, int seqno = SEQNO(old_bf->bf_state.bfs_seqno); ATH_TXQ_LOCK_ASSERT(sc->sc_ac2q[tid->ac]); + ATH_TID_LOCK_ASSERT(sc, tid); tap = ath_tx_get_tx_tid(an, tid->tid); index = ATH_BA_INDEX(tap->txa_start, seqno); @@ -2304,6 +2306,7 @@ ath_tx_xmit_aggr(struct ath_softc *sc, struct ath_node *an, struct ath_buf *bf) struct ieee80211_tx_ampdu *tap; ATH_TXQ_LOCK_ASSERT(txq); + ATH_TID_LOCK_ASSERT(sc, tid); tap = ath_tx_get_tx_tid(an, tid->tid); @@ -2374,6 +2377,8 @@ ath_tx_swq(struct ath_softc *sc, struct ieee80211_node *ni, struct ath_txq *txq, tid = ath_tx_gettid(sc, m0); atid = &an->an_tid[tid]; + ATH_TID_LOCK_ASSERT(sc, atid); + DPRINTF(sc, ATH_DEBUG_SW_TX, "%s: bf=%p, pri=%d, tid=%d, qos=%d\n", __func__, bf, pri, tid, IEEE80211_QOS_HAS_SEQ(wh)); diff --git a/sys/dev/ath/if_athvar.h b/sys/dev/ath/if_athvar.h index 51cfab1..07ed8af 100644 --- a/sys/dev/ath/if_athvar.h +++ b/sys/dev/ath/if_athvar.h @@ -302,6 +302,9 @@ struct ath_txq { #define ATH_TXQ_LOCK_ASSERT(_tq) mtx_assert(&(_tq)->axq_lock, MA_OWNED) #define ATH_TXQ_IS_LOCKED(_tq) mtx_owned(&(_tq)->axq_lock) +#define ATH_TID_LOCK_ASSERT(_sc, _tid) \ + ATH_TXQ_LOCK_ASSERT((_sc)->sc_ac2q[(_tid)->ac]) + #define ATH_TXQ_INSERT_HEAD(_tq, _elm, _field) do { \ TAILQ_INSERT_HEAD(&(_tq)->axq_q, (_elm), _field); \ (_tq)->axq_depth++; \ |