linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 6.2-rc3] wifi: mt76: fix dma error
@ 2023-01-10 22:39 Bert Karwatzki
  2023-01-11  7:54 ` Linux kernel regression tracking (Thorsten Leemhuis)
  0 siblings, 1 reply; 3+ messages in thread
From: Bert Karwatzki @ 2023-01-10 22:39 UTC (permalink / raw)
  To: linux-wireless; +Cc: Lorenzo Bianconi

Since linux-6.2-rc1 the mediatek mt76 wlan driver suffers from problems
https://bugzilla.kernel.org/show_bug.cgi?id=216901. I bisected this to
commit cd372b8c99c5a5cf6a464acebb7e4a79af7ec8ae and noticed that the

	if (txwi) {
		q->entry[q->head].txwi = DMA_DUMMY_DATA;
		q->entry[q->head].skip_buf0 = true;
	}

part is moved from the beginning of mt76_dma_add_buf to the
inside of the for loop. But q->head is modified at the beginning of
this loop.
 This patch puts at the beginning of mt76_dma_add_buf
diff -aur linux-6.2-rc3.old/drivers/net/wireless/mediatek/mt76/dma.c
linux-6.2-rc3/drivers/net/wireless/mediatek/mt76/dma.c
--- linux-6.2-rc3.old/drivers/net/wireless/mediatek/mt76/dma.c	2023-
01-08 18:49:43.000000000 +0100
+++ linux-6.2-rc3/drivers/net/wireless/mediatek/mt76/dma.c	2023-
01-09 22:07:29.533248047 +0100
@@ -215,6 +215,11 @@
 	u32 ctrl;
 	int i, idx = -1;
 
+	if (txwi) {
+		q->entry[q->head].txwi = DMA_DUMMY_DATA;
+		q->entry[q->head].skip_buf0 = true;
+	}
+
 	for (i = 0; i < nbufs; i += 2, buf += 2) {
 		u32 buf0 = buf[0].addr, buf1 = 0;
 
@@ -238,11 +243,6 @@
 			ctrl = FIELD_PREP(MT_DMA_CTL_SD_LEN0,
buf[0].len) |
 			       MT_DMA_CTL_TO_HOST;
 		} else {
-			if (txwi) {
-				q->entry[q->head].txwi =
DMA_DUMMY_DATA;
-				q->entry[q->head].skip_buf0 = true;
-			}
-
 			if (buf[0].skip_unmap)
 				entry->skip_buf0 = true;
 			entry->skip_buf1 = i == nbufs - 1; 

Bert Karwatzki

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-01-13 16:22 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-01-10 22:39 [PATCH 6.2-rc3] wifi: mt76: fix dma error Bert Karwatzki
2023-01-11  7:54 ` Linux kernel regression tracking (Thorsten Leemhuis)
2023-01-13 16:15   ` Kalle Valo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).