diff options
author | Felix Fietkau <nbd@nbd.name> | 2018-11-05 23:11:39 +0300 |
---|---|---|
committer | Felix Fietkau <nbd@nbd.name> | 2018-11-30 14:29:32 +0300 |
commit | 79d1c94c9c78ea2f90a7218e16946a1dde2527a0 (patch) | |
tree | 77c965da15fa0bd63e6e7bf9fa8f1aed8e4206e7 /drivers/net/wireless/mediatek/mt76/dma.c | |
parent | 4ece1e0a86b35bbb43d8d3e5268e68c6b4c6294e (diff) | |
download | linux-79d1c94c9c78ea2f90a7218e16946a1dde2527a0.tar.xz |
mt76: avoid queue/status spinlocks while passing tx status to mac80211
There is some code in the mac80211 tx status processing code that could
potentially call back into the tx codepath.
To avoid deadlocks, make sure that no tx related spinlocks are taken
during the ieee80211_tx_status call.
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Diffstat (limited to 'drivers/net/wireless/mediatek/mt76/dma.c')
-rw-r--r-- | drivers/net/wireless/mediatek/mt76/dma.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/drivers/net/wireless/mediatek/mt76/dma.c b/drivers/net/wireless/mediatek/mt76/dma.c index 2d7bd26875c6..d62f8d9f2ea1 100644 --- a/drivers/net/wireless/mediatek/mt76/dma.c +++ b/drivers/net/wireless/mediatek/mt76/dma.c @@ -157,17 +157,20 @@ mt76_dma_tx_cleanup(struct mt76_dev *dev, enum mt76_txq_id qid, bool flush) if (entry.schedule) q->swq_queued--; - if (entry.skb) + q->tail = (q->tail + 1) % q->ndesc; + q->queued--; + + if (entry.skb) { + spin_unlock_bh(&q->lock); dev->drv->tx_complete_skb(dev, q, &entry, flush); + spin_lock_bh(&q->lock); + } if (entry.txwi) { mt76_put_txwi(dev, entry.txwi); wake = true; } - q->tail = (q->tail + 1) % q->ndesc; - q->queued--; - if (!flush && q->tail == last) last = ioread32(&q->regs->dma_idx); } |