diff options
author | Lorenzo Bianconi <lorenzo@kernel.org> | 2020-07-17 10:57:39 +0200 |
---|---|---|
committer | Felix Fietkau <nbd@nbd.name> | 2020-07-21 19:01:18 +0200 |
commit | 1f8284150dbc6a6995d8647be025944ebc29ad26 (patch) | |
tree | 0c0b55f34d3da60d220d2ea273032d16b1b5cd90 /drivers/net/wireless/mediatek/mt76/sdio.c | |
parent | a66cbdd6573db8515735d37793c22605432c346d (diff) | |
download | linux-stable-1f8284150dbc6a6995d8647be025944ebc29ad26.tar.gz linux-stable-1f8284150dbc6a6995d8647be025944ebc29ad26.tar.bz2 linux-stable-1f8284150dbc6a6995d8647be025944ebc29ad26.zip |
mt76: mt76s: move queue accounting in mt76s_tx_queue_skb
In order to avoid possible overflows, move tx queue accounting from
mt7663s_tx_run_queue() to mt76s_tx_queue_skb_raw()/mt76s_tx_queue_skb()
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Diffstat (limited to 'drivers/net/wireless/mediatek/mt76/sdio.c')
-rw-r--r-- | drivers/net/wireless/mediatek/mt76/sdio.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/net/wireless/mediatek/mt76/sdio.c b/drivers/net/wireless/mediatek/mt76/sdio.c index a6f3255c4d84..d2b38ed7f3b4 100644 --- a/drivers/net/wireless/mediatek/mt76/sdio.c +++ b/drivers/net/wireless/mediatek/mt76/sdio.c @@ -138,6 +138,9 @@ static int mt76s_process_tx_queue(struct mt76_dev *dev, enum mt76_txq_id qid) bool wake; while (q->queued > n_dequeued) { + if (!q->entry[q->head].done) + break; + if (q->entry[q->head].schedule) { q->entry[q->head].schedule = false; n_sw_dequeued++; @@ -229,6 +232,7 @@ mt76s_tx_queue_skb(struct mt76_dev *dev, enum mt76_txq_id qid, q->entry[q->tail].skb = tx_info.skb; q->entry[q->tail].buf_sz = len; q->tail = (q->tail + 1) % q->ndesc; + q->queued++; return idx; } @@ -251,6 +255,7 @@ mt76s_tx_queue_skb_raw(struct mt76_dev *dev, enum mt76_txq_id qid, q->entry[q->tail].buf_sz = len; q->entry[q->tail].skb = skb; q->tail = (q->tail + 1) % q->ndesc; + q->queued++; out: spin_unlock_bh(&q->lock); |