Luis R. Rodriguez wrote: > @@ -1813,10 +1815,30 @@ int ath_tx_start(struct ath_softc *sc, struct sk_buff > *skb, > > r = ath_tx_setup_buffer(sc, bf, skb, txctl); > if (r) { > - spin_lock_bh(&sc->sc_txbuflock); > + struct ath_txq *txq = NULL; > + int qnum; > + > + qnum = ath_get_hal_qnum(skb_get_queue_mapping(skb), sc); > + txq = &sc->sc_txq[qnum]; > + > DPRINTF(sc, ATH_DBG_FATAL, "TX mem alloc failure\n"); > + > + /* upon ath_tx_processq() this TX queue will be resumed, we > + * guarantee this will happen by knowing beforehand that > + * we will at least have to run TX completionon one buffer > + * on the queue */ > + spin_lock_bh(&txq->axq_lock); > + if (ath_txq_depth(sc, txq->axq_qnum) > 1) { > + ieee80211_stop_queue(sc->hw, > + skb_get_queue_mapping(skb)); > + txq->stopped = 1; > + } > + spin_unlock_bh(&txq->axq_lock); > + > + spin_lock_bh(&sc->sc_txbuflock); > list_add_tail(&bf->list, &sc->sc_txbuf); > spin_unlock_bh(&sc->sc_txbuflock); > +
The queue is already available, we make sure of that before calling ath_tx_start(). And the queue is sent through txctl.txq, you don't have to calculate the queue number again. So, just stopping the queue and moving the buffer back to the free list would be enough. Sujith _______________________________________________ ath9k-devel mailing list ath9k-devel@lists.ath9k.org https://lists.ath9k.org/mailman/listinfo/ath9k-devel