Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 16 Aug 2011 00:43:25 +0000 (UTC)
From:      Adrian Chadd <adrian@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-user@freebsd.org
Subject:   svn commit: r224900 - user/adrian/if_ath_tx/sys/dev/ath
Message-ID:  <201108160043.p7G0hP5B033909@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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



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