summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/mediatek/mt76/mt76x02_mac.c
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@nbd.name>2019-02-01 00:38:28 +0300
committerFelix Fietkau <nbd@nbd.name>2019-05-01 14:03:59 +0300
commit6fe533378795f87bfa5075520742116f13d30ed3 (patch)
tree7c42cee4dea4cfbbe95ea2d65c2ce9af2b6817ec /drivers/net/wireless/mediatek/mt76/mt76x02_mac.c
parent2ac515a5d74f26963362d5da9589c67ca3663338 (diff)
downloadlinux-6fe533378795f87bfa5075520742116f13d30ed3.tar.xz
mt76: mt76x02: remove irqsave/restore in locking for tx status fifo
Use a separate lock and spin_trylock to avoid disabling interrupts. Should improve performance and latency Signed-off-by: Felix Fietkau <nbd@nbd.name>
Diffstat (limited to 'drivers/net/wireless/mediatek/mt76/mt76x02_mac.c')
-rw-r--r--drivers/net/wireless/mediatek/mt76/mt76x02_mac.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/net/wireless/mediatek/mt76/mt76x02_mac.c b/drivers/net/wireless/mediatek/mt76/mt76x02_mac.c
index 28851060aa0f..c1f041e1a279 100644
--- a/drivers/net/wireless/mediatek/mt76/mt76x02_mac.c
+++ b/drivers/net/wireless/mediatek/mt76/mt76x02_mac.c
@@ -739,7 +739,6 @@ int mt76x02_mac_process_rx(struct mt76x02_dev *dev, struct sk_buff *skb,
void mt76x02_mac_poll_tx_status(struct mt76x02_dev *dev, bool irq)
{
struct mt76x02_tx_status stat = {};
- unsigned long flags;
u8 update = 1;
bool ret;
@@ -749,9 +748,11 @@ void mt76x02_mac_poll_tx_status(struct mt76x02_dev *dev, bool irq)
trace_mac_txstat_poll(dev);
while (!irq || !kfifo_is_full(&dev->txstatus_fifo)) {
- spin_lock_irqsave(&dev->mt76.mmio.irq_lock, flags);
+ if (!spin_trylock(&dev->txstatus_fifo_lock))
+ break;
+
ret = mt76x02_mac_load_tx_status(dev, &stat);
- spin_unlock_irqrestore(&dev->mt76.mmio.irq_lock, flags);
+ spin_unlock(&dev->txstatus_fifo_lock);
if (!ret)
break;