mt76: avoid enabling interrupt if NAPI poll is still pending
authorFelix Fietkau <nbd@nbd.name>
Mon, 7 Oct 2019 10:33:39 +0000 (12:33 +0200)
committerFelix Fietkau <nbd@nbd.name>
Wed, 20 Nov 2019 12:23:50 +0000 (13:23 +0100)
if napi_complete() returns false, it means that polling is still pending.
Interrupts should not fire until the polling is no longer scheduled

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

index 6442a45..3de744f 100644 (file)
@@ -539,10 +539,8 @@ mt76_dma_rx_poll(struct napi_struct *napi, int budget)
 
        rcu_read_unlock();
 
-       if (done < budget) {
-               napi_complete(napi);
+       if (done < budget && napi_complete(napi))
                dev->drv->rx_poll_complete(dev, qid);
-       }
 
        return done;
 }