Skip to content

Commit bf20ce9

Browse files
LorenzoBianconikuba-moo
authored andcommitted
net: ethernet: mtk_wed: get rid of queue lock for tx queue
Similar to MTK Wireless Ethernet Dispatcher (WED) MCU rx queue, we do not need to protect WED MCU tx queue with a spin lock since the tx queue is accessed in the two following routines: - mtk_wed_wo_queue_tx_skb(): it is run at initialization and during mt7915 normal operation. Moreover MCU messages are serialized through MCU mutex. - mtk_wed_wo_queue_tx_clean(): it runs just at mt7915 driver module unload when no more messages are sent to the MCU. Remove tx queue spinlock. Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Link: https://lore.kernel.org/r/7bd0337b2a13ab1a63673b7c03fd35206b3b284e.1673515140.git.lorenzo@kernel.org Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent af6d103 commit bf20ce9

File tree

2 files changed

+0
-8
lines changed

2 files changed

+0
-8
lines changed

drivers/net/ethernet/mediatek/mtk_wed_wo.c

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,6 @@ mtk_wed_wo_queue_alloc(struct mtk_wed_wo *wo, struct mtk_wed_wo_queue *q,
258258
int n_desc, int buf_size, int index,
259259
struct mtk_wed_wo_queue_regs *regs)
260260
{
261-
spin_lock_init(&q->lock);
262261
q->regs = *regs;
263262
q->n_desc = n_desc;
264263
q->buf_size = buf_size;
@@ -290,7 +289,6 @@ mtk_wed_wo_queue_tx_clean(struct mtk_wed_wo *wo, struct mtk_wed_wo_queue *q)
290289
struct page *page;
291290
int i;
292291

293-
spin_lock_bh(&q->lock);
294292
for (i = 0; i < q->n_desc; i++) {
295293
struct mtk_wed_wo_queue_entry *entry = &q->entry[i];
296294

@@ -299,7 +297,6 @@ mtk_wed_wo_queue_tx_clean(struct mtk_wed_wo *wo, struct mtk_wed_wo_queue *q)
299297
skb_free_frag(entry->buf);
300298
entry->buf = NULL;
301299
}
302-
spin_unlock_bh(&q->lock);
303300

304301
if (!q->cache.va)
305302
return;
@@ -347,8 +344,6 @@ int mtk_wed_wo_queue_tx_skb(struct mtk_wed_wo *wo, struct mtk_wed_wo_queue *q,
347344
int ret = 0, index;
348345
u32 ctrl;
349346

350-
spin_lock_bh(&q->lock);
351-
352347
q->tail = mtk_wed_mmio_r32(wo, q->regs.dma_idx);
353348
index = (q->head + 1) % q->n_desc;
354349
if (q->tail == index) {
@@ -379,8 +374,6 @@ int mtk_wed_wo_queue_tx_skb(struct mtk_wed_wo *wo, struct mtk_wed_wo_queue *q,
379374
mtk_wed_wo_queue_kick(wo, q, q->head);
380375
mtk_wed_wo_kickout(wo);
381376
out:
382-
spin_unlock_bh(&q->lock);
383-
384377
dev_kfree_skb(skb);
385378

386379
return ret;

drivers/net/ethernet/mediatek/mtk_wed_wo.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,6 @@ struct mtk_wed_wo_queue {
211211
struct mtk_wed_wo_queue_regs regs;
212212

213213
struct page_frag_cache cache;
214-
spinlock_t lock;
215214

216215
struct mtk_wed_wo_queue_desc *desc;
217216
dma_addr_t desc_dma;

0 commit comments

Comments
 (0)