Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 68e8f2fa authored by Vasanthakumar Thiagarajan's avatar Vasanthakumar Thiagarajan Committed by John W. Linville
Browse files

ath9k: Fix inconsistency between txq->stopped and the actual queue state



Sometimes txq state(txq->stopped) can be marked as started but the actual
queue may not be started (in ATH_WIPHY_SCAN state, for example). Fix this.

Signed-off-by: default avatarVasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 2189d13f
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -687,7 +687,7 @@ bool ath9k_all_wiphys_idle(struct ath_softc *sc);
void ath9k_set_wiphy_idle(struct ath_wiphy *aphy, bool idle);

void ath_mac80211_stop_queue(struct ath_softc *sc, u16 skb_queue);
void ath_mac80211_start_queue(struct ath_softc *sc, u16 skb_queue);
bool ath_mac80211_start_queue(struct ath_softc *sc, u16 skb_queue);

void ath_start_rfkill_poll(struct ath_softc *sc);
extern void ath9k_rfkill_poll_state(struct ieee80211_hw *hw);
+5 −1
Original line number Diff line number Diff line
@@ -695,16 +695,18 @@ void ath9k_set_wiphy_idle(struct ath_wiphy *aphy, bool idle)
		  idle ? "idle" : "not-idle");
}
/* Only bother starting a queue on an active virtual wiphy */
void ath_mac80211_start_queue(struct ath_softc *sc, u16 skb_queue)
bool ath_mac80211_start_queue(struct ath_softc *sc, u16 skb_queue)
{
	struct ieee80211_hw *hw = sc->pri_wiphy->hw;
	unsigned int i;
	bool txq_started = false;

	spin_lock_bh(&sc->wiphy_lock);

	/* Start the primary wiphy */
	if (sc->pri_wiphy->state == ATH_WIPHY_ACTIVE) {
		ieee80211_wake_queue(hw, skb_queue);
		txq_started = true;
		goto unlock;
	}

@@ -718,11 +720,13 @@ void ath_mac80211_start_queue(struct ath_softc *sc, u16 skb_queue)

		hw = aphy->hw;
		ieee80211_wake_queue(hw, skb_queue);
		txq_started = true;
		break;
	}

unlock:
	spin_unlock_bh(&sc->wiphy_lock);
	return txq_started;
}

/* Go ahead and propagate information to all virtual wiphys, it won't hurt */
+2 −2
Original line number Diff line number Diff line
@@ -2077,7 +2077,7 @@ static void ath_wake_mac80211_queue(struct ath_softc *sc, struct ath_txq *txq)

	spin_lock_bh(&txq->axq_lock);
	if (txq->stopped && sc->tx.pending_frames[qnum] < ATH_MAX_QDEPTH) {
		ath_mac80211_start_queue(sc, qnum);
		if (ath_mac80211_start_queue(sc, qnum))
			txq->stopped = 0;
	}
	spin_unlock_bh(&txq->axq_lock);