From owner-svn-src-all@FreeBSD.ORG Mon Jun 11 07:06:50 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 74C44106566B; Mon, 11 Jun 2012 07:06:50 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 46CC68FC08; Mon, 11 Jun 2012 07:06:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5B76oEk049167; Mon, 11 Jun 2012 07:06:50 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5B76oem049164; Mon, 11 Jun 2012 07:06:50 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201206110706.q5B76oem049164@svn.freebsd.org> From: Adrian Chadd Date: Mon, 11 Jun 2012 07:06:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236873 - head/sys/dev/ath X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jun 2012 07:06:50 -0000 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++; \