Search Linux Wireless

[PATCH 6.2-rc3] wifi: mt76: fix dma error

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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




[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Wireless Regulations]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux