1 From: Lorenzo Bianconi <lorenzo@kernel.org>
2 Date: Tue, 10 Jan 2023 10:31:26 +0100
3 Subject: [PATCH] net: ethernet: mtk_wed: get rid of queue lock for rx queue
5 Queue spinlock is currently held in mtk_wed_wo_queue_rx_clean and
6 mtk_wed_wo_queue_refill routines for MTK Wireless Ethernet Dispatcher
7 MCU rx queue. mtk_wed_wo_queue_refill() is running during initialization
8 and in rx tasklet while mtk_wed_wo_queue_rx_clean() is running in
9 mtk_wed_wo_hw_deinit() during hw de-init phase after rx tasklet has been
10 disabled. Since mtk_wed_wo_queue_rx_clean and mtk_wed_wo_queue_refill
11 routines can't run concurrently get rid of spinlock for mcu rx queue.
13 Reviewed-by: Alexander Duyck <alexanderduyck@fb.com>
14 Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
15 Link: https://lore.kernel.org/r/36ec3b729542ea60898471d890796f745479ba32.1673342990.git.lorenzo@kernel.org
16 Signed-off-by: Jakub Kicinski <kuba@kernel.org>
19 --- a/drivers/net/ethernet/mediatek/mtk_wed_wo.c
20 +++ b/drivers/net/ethernet/mediatek/mtk_wed_wo.c
21 @@ -138,7 +138,6 @@ mtk_wed_wo_queue_refill(struct mtk_wed_w
22 enum dma_data_direction dir = rx ? DMA_FROM_DEVICE : DMA_TO_DEVICE;
25 - spin_lock_bh(&q->lock);
26 while (q->queued < q->n_desc) {
27 struct mtk_wed_wo_queue_entry *entry;
29 @@ -172,7 +171,6 @@ mtk_wed_wo_queue_refill(struct mtk_wed_w
33 - spin_unlock_bh(&q->lock);
37 @@ -316,7 +314,6 @@ mtk_wed_wo_queue_rx_clean(struct mtk_wed
41 - spin_lock_bh(&q->lock);
43 void *buf = mtk_wed_wo_dequeue(wo, q, NULL, true);
45 @@ -325,7 +322,6 @@ mtk_wed_wo_queue_rx_clean(struct mtk_wed
49 - spin_unlock_bh(&q->lock);