mt76: reduce locking in mt76_dma_tx_cleanup
authorFelix Fietkau <nbd@nbd.name>
Thu, 31 Jan 2019 21:39:32 +0000 (22:39 +0100)
committerFelix Fietkau <nbd@nbd.name>
Wed, 1 May 2019 11:03:58 +0000 (13:03 +0200)
commit9d7c6f755ae9a6858828bc4664f3081e32d5b4d9
tree8d7f8effa194ec90af24b1b45d192334779ad424
parentd704dbf37c61401d86a8d59657d1588f217f935b
mt76: reduce locking in mt76_dma_tx_cleanup

q->tail can be safely updated without locking, because there is no
concurrent access. If called from outside of the tasklet (for flushing),
the tasklet is always disabled.
q->queued can be safely read without locking, as long as the decrement
happens within the locked section.
This patch allows cleaning up tx packets outside of the section that holds
the queue lock for improved performance

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