From 6bbf566f5d8c2c0697f87ff081e6f996e799069a Mon Sep 17 00:00:00 2001 From: adrian Date: Mon, 13 May 2013 19:03:12 +0000 Subject: Since the node state is 100% back under the TX lock, just kill the use of atomics. I'll re-think this nonsense later. --- sys/dev/ath/if_ath.c | 15 ++++----------- sys/dev/ath/if_athvar.h | 12 ++++++------ 2 files changed, 10 insertions(+), 17 deletions(-) (limited to 'sys/dev') diff --git a/sys/dev/ath/if_ath.c b/sys/dev/ath/if_ath.c index 4416256..991c42d 100644 --- a/sys/dev/ath/if_ath.c +++ b/sys/dev/ath/if_ath.c @@ -6028,7 +6028,7 @@ ath_node_set_tim(struct ieee80211_node *ni, int enable) an->an_tim_set = 1; ATH_TX_UNLOCK(sc); changed = avp->av_set_tim(ni, enable); - } else if (atomic_load_acq_int(&an->an_swq_depth) == 0) { + } else if (an->an_swq_depth == 0) { /* disable */ DPRINTF(sc, ATH_DEBUG_NODE_PWRSAVE, "%s: an=%p, enable=%d, an_swq_depth == 0, disabling\n", @@ -6120,16 +6120,9 @@ ath_tx_update_tim(struct ath_softc *sc, struct ieee80211_node *ni, ATH_TX_LOCK_ASSERT(sc); if (enable) { - /* - * Don't bother grabbing the lock unless the queue is not - * empty. - */ - if (atomic_load_acq_int(&an->an_swq_depth) == 0) - return; - if (an->an_is_powersave && an->an_tim_set == 0 && - atomic_load_acq_int(&an->an_swq_depth) != 0) { + an->an_swq_depth != 0) { DPRINTF(sc, ATH_DEBUG_NODE_PWRSAVE, "%s: an=%p, swq_depth>0, tim_set=0, set!\n", __func__, an); @@ -6140,13 +6133,13 @@ ath_tx_update_tim(struct ath_softc *sc, struct ieee80211_node *ni, /* * Don't bother grabbing the lock unless the queue is empty. */ - if (atomic_load_acq_int(&an->an_swq_depth) != 0) + if (&an->an_swq_depth != 0) return; if (an->an_is_powersave && an->an_stack_psq == 0 && an->an_tim_set == 1 && - atomic_load_acq_int(&an->an_swq_depth) == 0) { + an->an_swq_depth == 0) { DPRINTF(sc, ATH_DEBUG_NODE_PWRSAVE, "%s: an=%p, swq_depth=0, tim_set=1, psq_set=0," " clear!\n", diff --git a/sys/dev/ath/if_athvar.h b/sys/dev/ath/if_athvar.h index 7b7adbd..5f933d7 100644 --- a/sys/dev/ath/if_athvar.h +++ b/sys/dev/ath/if_athvar.h @@ -415,17 +415,17 @@ struct ath_txq { #define ATH_TID_INSERT_HEAD(_tq, _elm, _field) do { \ TAILQ_INSERT_HEAD(&(_tq)->tid_q, (_elm), _field); \ (_tq)->axq_depth++; \ - atomic_add_rel_32( &((_tq)->an)->an_swq_depth, 1); \ + (_tq)->an->an_swq_depth++; \ } while (0) #define ATH_TID_INSERT_TAIL(_tq, _elm, _field) do { \ TAILQ_INSERT_TAIL(&(_tq)->tid_q, (_elm), _field); \ (_tq)->axq_depth++; \ - atomic_add_rel_32( &((_tq)->an)->an_swq_depth, 1); \ + (_tq)->an->an_swq_depth++; \ } while (0) #define ATH_TID_REMOVE(_tq, _elm, _field) do { \ TAILQ_REMOVE(&(_tq)->tid_q, _elm, _field); \ (_tq)->axq_depth--; \ - atomic_subtract_rel_32( &((_tq)->an)->an_swq_depth, 1); \ + (_tq)->an->an_swq_depth--; \ } while (0) #define ATH_TID_FIRST(_tq) TAILQ_FIRST(&(_tq)->tid_q) #define ATH_TID_LAST(_tq, _field) TAILQ_LAST(&(_tq)->tid_q, _field) @@ -436,17 +436,17 @@ struct ath_txq { #define ATH_TID_FILT_INSERT_HEAD(_tq, _elm, _field) do { \ TAILQ_INSERT_HEAD(&(_tq)->filtq.tid_q, (_elm), _field); \ (_tq)->axq_depth++; \ - atomic_add_rel_32( &((_tq)->an)->an_swq_depth, 1); \ + (_tq)->an->an_swq_depth++; \ } while (0) #define ATH_TID_FILT_INSERT_TAIL(_tq, _elm, _field) do { \ TAILQ_INSERT_TAIL(&(_tq)->filtq.tid_q, (_elm), _field); \ (_tq)->axq_depth++; \ - atomic_add_rel_32( &((_tq)->an)->an_swq_depth, 1); \ + (_tq)->an->an_swq_depth++; \ } while (0) #define ATH_TID_FILT_REMOVE(_tq, _elm, _field) do { \ TAILQ_REMOVE(&(_tq)->filtq.tid_q, _elm, _field); \ (_tq)->axq_depth--; \ - atomic_subtract_rel_32( &((_tq)->an)->an_swq_depth, 1); \ + (_tq)->an->an_swq_depth--; \ } while (0) #define ATH_TID_FILT_FIRST(_tq) TAILQ_FIRST(&(_tq)->filtq.tid_q) #define ATH_TID_FILT_LAST(_tq, _field) TAILQ_LAST(&(_tq)->filtq.tid_q,_field) -- cgit v1.1