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

* Re: [PATCH 6.2-rc3] wifi: mt76: fix dma error
  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
  0 siblings, 1 reply; 3+ messages in thread
From: Linux kernel regression tracking (Thorsten Leemhuis) @ 2023-01-11  7:54 UTC (permalink / raw)
  To: Bert Karwatzki
  Cc: Lorenzo Bianconi, Felix Fietkau, linux-wireless,
	regressions@lists.linux.dev

[CCing Felix]

On 10.01.23 23:39, Bert Karwatzki wrote:
> 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.

Thx for your patch. TWIMC, a earlier (and tested) patch to address that
regression can afaics be found here:

https://lore.kernel.org/lkml/3cb53fbd-0bee-22f9-bba2-6ac4a87db521@nbd.name/

Makes me wonder: Felix, btw, did you ever properly submit that patch for
inclusion? Where? I can't find it with lore. :-/ Or will it be addressed
by a different patch?

/me really hopes we can get this resolved this week before rc4 ships, as
it seems this regressions bothers quite a few people

Ciao, Thorsten (wearing his 'the Linux kernel's regression tracker' hat)
--
Everything you wanna know about Linux kernel regression tracking:
https://linux-regtracking.leemhuis.info/about/#tldr
That page also explains what to do if mails like this annoy you.

P.S.:

#regzbot ^backmonitor: https://bugzilla.kernel.org/show_bug.cgi?id=216901

>  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

* Re: [PATCH 6.2-rc3] wifi: mt76: fix dma error
  2023-01-11  7:54 ` Linux kernel regression tracking (Thorsten Leemhuis)
@ 2023-01-13 16:15   ` Kalle Valo
  0 siblings, 0 replies; 3+ messages in thread
From: Kalle Valo @ 2023-01-13 16:15 UTC (permalink / raw)
  To: Linux kernel regression tracking (Thorsten Leemhuis)
  Cc: Bert Karwatzki, Linux regressions mailing list, Lorenzo Bianconi,
	Felix Fietkau, linux-wireless

"Linux kernel regression tracking (Thorsten Leemhuis)"
<regressions@leemhuis.info> writes:

> [CCing Felix]
>
> On 10.01.23 23:39, Bert Karwatzki wrote:
>> 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.
>
> Thx for your patch. TWIMC, a earlier (and tested) patch to address that
> regression can afaics be found here:
>
> https://lore.kernel.org/lkml/3cb53fbd-0bee-22f9-bba2-6ac4a87db521@nbd.name/
>
> Makes me wonder: Felix, btw, did you ever properly submit that patch for
> inclusion? Where? I can't find it with lore. :-/ Or will it be addressed
> by a different patch?

The patch is now in my queue:

https://patchwork.kernel.org/project/linux-wireless/patch/20230113105848.34642-3-nbd@nbd.name/

> /me really hopes we can get this resolved this week before rc4 ships, as
> it seems this regressions bothers quite a few people

If all goes well this should make it to v6.2-rc5.

-- 
https://patchwork.kernel.org/project/linux-wireless/list/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches

^ 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).