From owner-svn-src-user@FreeBSD.ORG Tue Aug 16 00:43:25 2011 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D2E191065676; Tue, 16 Aug 2011 00:43:25 +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 A86028FC1A; Tue, 16 Aug 2011 00:43:25 +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 p7G0hP9J033911; Tue, 16 Aug 2011 00:43:25 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p7G0hP5B033909; Tue, 16 Aug 2011 00:43:25 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201108160043.p7G0hP5B033909@svn.freebsd.org> From: Adrian Chadd Date: Tue, 16 Aug 2011 00:43:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224900 - user/adrian/if_ath_tx/sys/dev/ath X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Aug 2011 00:43:25 -0000 Author: adrian Date: Tue Aug 16 00:43:25 2011 New Revision: 224900 URL: http://svn.freebsd.org/changeset/base/224900 Log: Add a missing lock arounnd ath_tid->paused, just to be correct. Update some comments to better reflect reality. Modified: user/adrian/if_ath_tx/sys/dev/ath/if_ath_tx.c Modified: user/adrian/if_ath_tx/sys/dev/ath/if_ath_tx.c ============================================================================== --- user/adrian/if_ath_tx/sys/dev/ath/if_ath_tx.c Mon Aug 15 20:31:27 2011 (r224899) +++ user/adrian/if_ath_tx/sys/dev/ath/if_ath_tx.c Tue Aug 16 00:43:25 2011 (r224900) @@ -1821,8 +1821,8 @@ ath_tx_tid_init(struct ath_softc *sc, st * Pause the current TID. This stops packets from being transmitted * on it. * - * XXX As this is being called from upper layers, it needs to be - * XXX properly locked! + * Since this is also called from upper layers as well as the driver, + * it will get the TID lock. */ static void ath_tx_tid_pause(struct ath_softc *sc, struct ath_tid *tid) @@ -1837,8 +1837,8 @@ ath_tx_tid_pause(struct ath_softc *sc, s /* * Unpause the current TID, and schedule it if needed. * - * XXX As this is being called from upper layers, it needs to be - * XXX properly locked! + * Since this is called from upper layers as well as the driver, + * it will get the TID lock and the TXQ lock if needed. */ static void ath_tx_tid_resume(struct ath_softc *sc, struct ath_tid *tid) @@ -2410,15 +2410,21 @@ ath_txq_sched(struct ath_softc *sc, stru /* * Suspend paused queues here; they'll be resumed * once the addba completes or times out. + * + * Since this touches tid->paused, it should lock + * the TID lock before checking. */ DPRINTF(sc, ATH_DEBUG_SW_TX, "%s: tid=%d, paused=%d\n", __func__, atid->tid, atid->paused); + ATH_TXQ_LOCK(atid); if (atid->paused) { + ATH_TXQ_UNLOCK(atid); ATH_TXQ_LOCK(txq); ath_tx_tid_unsched(sc, atid->an, atid->tid); ATH_TXQ_UNLOCK(txq); continue; } + ATH_TXQ_UNLOCK(atid); if (ath_tx_ampdu_running(sc, atid->an, atid->tid)) ath_tx_tid_hw_queue_aggr(sc, atid->an, atid->tid); else