Skip to content

Commit d4f12a8

Browse files
LorenzoBianconikuba-moo
authored andcommitted
net: ethernet: mtk_wed: get rid of queue lock for rx queue
Queue spinlock is currently held in mtk_wed_wo_queue_rx_clean and mtk_wed_wo_queue_refill routines for MTK Wireless Ethernet Dispatcher MCU rx queue. mtk_wed_wo_queue_refill() is running during initialization and in rx tasklet while mtk_wed_wo_queue_rx_clean() is running in mtk_wed_wo_hw_deinit() during hw de-init phase after rx tasklet has been disabled. Since mtk_wed_wo_queue_rx_clean and mtk_wed_wo_queue_refill routines can't run concurrently get rid of spinlock for mcu rx queue. Reviewed-by: Alexander Duyck <[email protected]> Signed-off-by: Lorenzo Bianconi <[email protected]> Link: https://lore.kernel.org/r/36ec3b729542ea60898471d890796f745479ba32.1673342990.git.lorenzo@kernel.org Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 93e71ed commit d4f12a8

File tree

1 file changed

+0
-4
lines changed

1 file changed

+0
-4
lines changed

drivers/net/ethernet/mediatek/mtk_wed_wo.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,6 @@ mtk_wed_wo_queue_refill(struct mtk_wed_wo *wo, struct mtk_wed_wo_queue *q,
138138
enum dma_data_direction dir = rx ? DMA_FROM_DEVICE : DMA_TO_DEVICE;
139139
int n_buf = 0;
140140

141-
spin_lock_bh(&q->lock);
142141
while (q->queued < q->n_desc) {
143142
struct mtk_wed_wo_queue_entry *entry;
144143
dma_addr_t addr;
@@ -172,7 +171,6 @@ mtk_wed_wo_queue_refill(struct mtk_wed_wo *wo, struct mtk_wed_wo_queue *q,
172171
q->queued++;
173172
n_buf++;
174173
}
175-
spin_unlock_bh(&q->lock);
176174

177175
return n_buf;
178176
}
@@ -316,7 +314,6 @@ mtk_wed_wo_queue_rx_clean(struct mtk_wed_wo *wo, struct mtk_wed_wo_queue *q)
316314
{
317315
struct page *page;
318316

319-
spin_lock_bh(&q->lock);
320317
for (;;) {
321318
void *buf = mtk_wed_wo_dequeue(wo, q, NULL, true);
322319

@@ -325,7 +322,6 @@ mtk_wed_wo_queue_rx_clean(struct mtk_wed_wo *wo, struct mtk_wed_wo_queue *q)
325322

326323
skb_free_frag(buf);
327324
}
328-
spin_unlock_bh(&q->lock);
329325

330326
if (!q->cache.va)
331327
return;

0 commit comments

Comments
 (0)