Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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 <alexanderduyck@fb.com>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Link: https://lore.kernel.org/r/36ec3b729542ea60898471d890796f745479ba32.1673342990.git.lorenzo@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Lorenzo Bianconi and committed by
Jakub Kicinski
d4f12a82 93e71edf

-4
-4
drivers/net/ethernet/mediatek/mtk_wed_wo.c
··· 138 138 enum dma_data_direction dir = rx ? DMA_FROM_DEVICE : DMA_TO_DEVICE; 139 139 int n_buf = 0; 140 140 141 - spin_lock_bh(&q->lock); 142 141 while (q->queued < q->n_desc) { 143 142 struct mtk_wed_wo_queue_entry *entry; 144 143 dma_addr_t addr; ··· 171 172 q->queued++; 172 173 n_buf++; 173 174 } 174 - spin_unlock_bh(&q->lock); 175 175 176 176 return n_buf; 177 177 } ··· 314 316 { 315 317 struct page *page; 316 318 317 - spin_lock_bh(&q->lock); 318 319 for (;;) { 319 320 void *buf = mtk_wed_wo_dequeue(wo, q, NULL, true); 320 321 ··· 322 325 323 326 skb_free_frag(buf); 324 327 } 325 - spin_unlock_bh(&q->lock); 326 328 327 329 if (!q->cache.va) 328 330 return;