Commit e207afa0 authored by Lorenzo Bianconi's avatar Lorenzo Bianconi Committed by Felix Fietkau

mt76: usb: avoid queue/status spinlocks while passing tx status to mac80211

As already done for pcie code in commit 79d1c94c ("mt76: avoid
queue/status spinlocks while passing tx status to mac80211") make sure
that no tx related spinlocks are taken during the ieee80211_tx_status call
Signed-off-by: default avatarLorenzo Bianconi <lorenzo.bianconi@redhat.com>
Signed-off-by: default avatarFelix Fietkau <nbd@nbd.name>
parent 4989338e
...@@ -583,6 +583,7 @@ static void mt76u_stop_rx(struct mt76_dev *dev) ...@@ -583,6 +583,7 @@ static void mt76u_stop_rx(struct mt76_dev *dev)
static void mt76u_tx_tasklet(unsigned long data) static void mt76u_tx_tasklet(unsigned long data)
{ {
struct mt76_dev *dev = (struct mt76_dev *)data; struct mt76_dev *dev = (struct mt76_dev *)data;
struct mt76_queue_entry entry;
struct mt76u_buf *buf; struct mt76u_buf *buf;
struct mt76_queue *q; struct mt76_queue *q;
bool wake; bool wake;
...@@ -597,17 +598,18 @@ static void mt76u_tx_tasklet(unsigned long data) ...@@ -597,17 +598,18 @@ static void mt76u_tx_tasklet(unsigned long data)
if (!buf->done || !q->queued) if (!buf->done || !q->queued)
break; break;
dev->drv->tx_complete_skb(dev, q,
&q->entry[q->head],
false);
if (q->entry[q->head].schedule) { if (q->entry[q->head].schedule) {
q->entry[q->head].schedule = false; q->entry[q->head].schedule = false;
q->swq_queued--; q->swq_queued--;
} }
entry = q->entry[q->head];
q->head = (q->head + 1) % q->ndesc; q->head = (q->head + 1) % q->ndesc;
q->queued--; q->queued--;
spin_unlock_bh(&q->lock);
dev->drv->tx_complete_skb(dev, q, &entry, false);
spin_lock_bh(&q->lock);
} }
mt76_txq_schedule(dev, q); mt76_txq_schedule(dev, q);
wake = i < IEEE80211_NUM_ACS && q->queued < q->ndesc - 8; wake = i < IEEE80211_NUM_ACS && q->queued < q->ndesc - 8;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment