Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 11 Jun 2012 07:06:50 +0000 (UTC)
From:      Adrian Chadd <adrian@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r236873 - head/sys/dev/ath
Message-ID:  <201206110706.q5B76oem049164@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: adrian
Date: Mon Jun 11 07:06:49 2012
New Revision: 236873
URL: http://svn.freebsd.org/changeset/base/236873

Log:
  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.

Modified:
  head/sys/dev/ath/if_ath_tx.c
  head/sys/dev/ath/if_athvar.h

Modified: head/sys/dev/ath/if_ath_tx.c
==============================================================================
--- head/sys/dev/ath/if_ath_tx.c	Mon Jun 11 06:59:28 2012	(r236872)
+++ head/sys/dev/ath/if_ath_tx.c	Mon Jun 11 07:06:49 2012	(r236873)
@@ -2030,6 +2030,7 @@ ath_tx_addto_baw(struct ath_softc *sc, s
 	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 *
 	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, s
 	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 
 	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));
 

Modified: head/sys/dev/ath/if_athvar.h
==============================================================================
--- head/sys/dev/ath/if_athvar.h	Mon Jun 11 06:59:28 2012	(r236872)
+++ head/sys/dev/ath/if_athvar.h	Mon Jun 11 07:06:49 2012	(r236873)
@@ -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++; \



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201206110706.q5B76oem049164>