mt76: mt7915: do not do any work in napi poll after calling napi_complete_done()
authorFelix Fietkau <nbd@nbd.name>
Fri, 7 Aug 2020 18:57:46 +0000 (20:57 +0200)
committerFelix Fietkau <nbd@nbd.name>
Thu, 24 Sep 2020 16:10:14 +0000 (18:10 +0200)
Fixes a race condition where multiple tx cleanup or sta poll tasks could run
in parallel.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
drivers/net/wireless/mediatek/mt76/mt7915/dma.c

index a8832c5..8a1ae08 100644 (file)
@@ -95,16 +95,13 @@ static int mt7915_poll_tx(struct napi_struct *napi, int budget)
        dev = container_of(napi, struct mt7915_dev, mt76.tx_napi);
 
        mt7915_tx_cleanup(dev);
-
-       if (napi_complete_done(napi, 0))
-               mt7915_irq_enable(dev, MT_INT_TX_DONE_ALL);
-
-       mt7915_tx_cleanup(dev);
-
        mt7915_mac_sta_poll(dev);
 
        tasklet_schedule(&dev->mt76.tx_tasklet);
 
+       if (napi_complete_done(napi, 0))
+               mt7915_irq_enable(dev, MT_INT_TX_DONE_ALL);
+
        return 0;
 }