Skip to contentSkip to conversation

net: ethernet: mtk_wed: increase WED v2 WDMA RESV_BUFF to 0x80

PATCH Applied Shiji Yang 6 participants 8 messages Aug 19 – Aug 24

Subsystems (4)
lore
Share & tools
lore

Shiji Yang

author
#0 lore raw

PATCH 1/1 net: ethernet: mtk_wed: increase WED v2 WDMA RESV_BUFF to 0x80

Change WDMA RESV_BUFF from 0x40 to 0x80 to avoid CDM TX FIFO overflow. Without this patch mt7986 and mt7981 may have WDMA TX hang issue. This patch was pulled from mtk-openwrt-feeds GPL open source project.

---
 drivers/net/ethernet/mediatek/mtk_wed.c      | 5 +++++
 drivers/net/ethernet/mediatek/mtk_wed_regs.h | 1 +
 2 files changed, 6 insertions(+)
drivers/net/ethernet/mediatek/mtk_wed.c +5 -0
index 10d9beaae..53d3b7e00 100644
@@ -2071,6 +2071,11 @@ mtk_wed_dma_enable(struct mtk_wed_device *dev)
 		wdma_set(dev, MTK_WDMA_GLO_CFG, MTK_WDMA_GLO_CFG_TX_DMA_EN);
 	}
 
+	if (mtk_wed_is_v2(dev->hw))
+		wdma_m32(dev, MTK_WDMA_GLO_CFG,
+			 MTK_WDMA_GLO_CFG_RESV_BUFF,
+			 FIELD_PREP(MTK_WDMA_GLO_CFG_RESV_BUFF, 0x80));
+
 	wed_set(dev, MTK_WED_GLO_CFG,
 		MTK_WED_GLO_CFG_TX_DMA_EN |
 		MTK_WED_GLO_CFG_RX_DMA_EN);
drivers/net/ethernet/mediatek/mtk_wed_regs.h +1 -0
index c71190924..e5f83100d 100644
@@ -433,6 +433,7 @@ struct mtk_wdma_desc {
 #define MTK_WDMA_GLO_CFG_TX_DMA_BUSY			BIT(1)
 #define MTK_WDMA_GLO_CFG_RX_DMA_EN			BIT(2)
 #define MTK_WDMA_GLO_CFG_RX_DMA_BUSY			BIT(3)
+#define MTK_WDMA_GLO_CFG_RESV_BUFF			GENMASK(23, 16)
 #define MTK_WDMA_GLO_CFG_RX_INFO3_PRERES		BIT(26)
 #define MTK_WDMA_GLO_CFG_RX_INFO2_PRERES		BIT(27)
 #define MTK_WDMA_GLO_CFG_RX_INFO1_PRERES		BIT(28)
Signature · 1 line
2.53.0
reviewer Reviewed-by on v1 1/1
#1 lore raw
Quoted 6 lines · Shiji Yang

Change WDMA RESV_BUFF from 0x40 to 0x80 to avoid CDM TX FIFO overflow. Without this patch mt7986 and mt7981 may have WDMA TX hang issue. This patch was pulled from mtk-openwrt-feeds GPL open source project.

As a bug fix for code present in the net tree, this should

1. Be targeted at the net tree

Subject: [PATCH net] ...

2. Be CCed to stable

3. Have a fixes tag. Perhaps this one?

Fixes cf26df8833cc ("net: ethernet: mtk_eth_wed: add mtk_wed_configure_irq and mtk_wed_dma_{enable/disable}")

I'm unsure if the maintainers would like a repost because of this. But at any rate, please keep it in mind for the future.

More information on the netdev development processes can be found here:
https://docs.kernel.org/process/maintainer-netdev.html

The above not withstanding, this looks good to me.

maintainer
#2 lore raw
In reply to Shiji Yang
Quoted 3 lines · On Wed, 19 Aug 2026 21:07:07 +0800 Shiji Yang wrote:

Change WDMA RESV_BUFF from 0x40 to 0x80 to avoid CDM TX FIFO overflow. Without this patch mt7986 and mt7981 may have WDMA TX hang issue. This patch was pulled from mtk-openwrt-feeds GPL open source project.

Lorenzo, could you TAL? (incl. Simon's suggestion of the Fixes tag)

maintainer
#3 lore raw
Quoted 6 lines · Jakub Kicinski
Quoted 3 lines · On Wed, 19 Aug 2026 21:07:07 +0800 Shiji Yang wrote:

Change WDMA RESV_BUFF from 0x40 to 0x80 to avoid CDM TX FIFO overflow. Without this patch mt7986 and mt7981 may have WDMA TX hang issue. This patch was pulled from mtk-openwrt-feeds GPL open source project.

Lorenzo, could you TAL? (incl. Simon's suggestion of the Fixes tag)

sure, I am AFK now, I will review it next week.

Regards,
Lorenzo

maintainer
#4 lore raw
Quoted 7 lines · Jakub Kicinski
Quoted 6 lines · On Wed, 19 Aug 2026 21:07:07 +0800 Shiji Yang wrote:
Quoted 3 lines

Change WDMA RESV_BUFF from 0x40 to 0x80 to avoid CDM TX FIFO overflow. Without this patch mt7986 and mt7981 may have WDMA TX hang issue. This patch was pulled from mtk-openwrt-feeds GPL open source project.

Lorenzo, could you TAL? (incl. Simon's suggestion of the Fixes tag)

I am wondering if this is necessary for v3 as well. @Rex any input on it?

Regarding Fixes tag, I think cf26df8833cc is the right one.

Regards,
Lorenzo

Quoted 5 lines

sure, I am AFK now, I will review it next week.

Regards,
Lorenzo

#5 lore raw

Hi Lorenzo,

it is only for v2. v3 changed the hw design and fixed it. so this RESV_BUFF register was removed

Thanks
Rex Lu
________________________________________
寄件者: Lorenzo Bianconi
已傳送: 星期一, 2026 年 8 月 24 日 下午 03:48
收件者: Jakub Kicinski
副本: Shiji Yang; [email protected]; Rex Lu (盧建銘); Felix Fietkau; Andrew Lunn; David S. Miller; Eric Dumazet; Paolo Abeni; Matthias Brugger; AngeloGioacchino Del Regno; [email protected]; [email protected]; [email protected] 主旨: Re: [PATCH] net: ethernet: mtk_wed: increase WED v2 WDMA RESV_BUFF to 0x80

Quoted 7 lines · Jakub Kicinski
Quoted 6 lines · On Wed, 19 Aug 2026 21:07:07 +0800 Shiji Yang wrote:
Quoted 3 lines

Change WDMA RESV_BUFF from 0x40 to 0x80 to avoid CDM TX FIFO overflow. Without this patch mt7986 and mt7981 may have WDMA TX hang issue. This patch was pulled from mtk-openwrt-feeds GPL open source project.

Lorenzo, could you TAL? (incl. Simon's suggestion of the Fixes tag)

I am wondering if this is necessary for v3 as well. @Rex any input on it?

Regarding Fixes tag, I think cf26df8833cc is the right one.

Regards,
Lorenzo

Quoted 5 lines

sure, I am AFK now, I will review it next week.

Regards,
Lorenzo

maintainer Acked-by
#6 lore raw
Quoted 3 lines

Hi Lorenzo,

it is only for v2. v3 changed the hw design and fixed it. so this RESV_BUFF register was removed

Hi Rex,

thx for pointing this out. In this case:

Quoted 33 lines

Thanks
Rex Lu
________________________________________
寄件者: Lorenzo Bianconi
已傳送: 星期一, 2026 年 8 月 24 日 下午 03:48
收件者: Jakub Kicinski
副本: Shiji Yang; [email protected]; Rex Lu (盧建銘); Felix Fietkau; Andrew Lunn; David S. Miller; Eric Dumazet; Paolo Abeni; Matthias Brugger; AngeloGioacchino Del Regno; [email protected]; [email protected]; [email protected] 主旨: Re: [PATCH] net: ethernet: mtk_wed: increase WED v2 WDMA RESV_BUFF to 0x80

Quoted 7 lines · Jakub Kicinski
Quoted 6 lines · On Wed, 19 Aug 2026 21:07:07 +0800 Shiji Yang wrote:
Quoted 3 lines

Change WDMA RESV_BUFF from 0x40 to 0x80 to avoid CDM TX FIFO overflow. Without this patch mt7986 and mt7981 may have WDMA TX hang issue. This patch was pulled from mtk-openwrt-feeds GPL open source project.

Lorenzo, could you TAL? (incl. Simon's suggestion of the Fixes tag)

I am wondering if this is necessary for v3 as well. @Rex any input on it?

Regarding Fixes tag, I think cf26df8833cc is the right one.

Regards,
Lorenzo

Quoted 5 lines

sure, I am AFK now, I will review it next week.

Regards,
Lorenzo

#7 lore raw
In reply to Shiji Yang
This patch was applied to netdev/net.git (main) by Jakub Kicinski <[email protected]>:

Hello:

This patch was applied to netdev/net.git (main)
by Jakub Kicinski <[email protected]>:

Quoted 8 lines · On Wed, 19 Aug 2026 21:07:07 +0800 you wrote:

Change WDMA RESV_BUFF from 0x40 to 0x80 to avoid CDM TX FIFO overflow. Without this patch mt7986 and mt7981 may have WDMA TX hang issue. This patch was pulled from mtk-openwrt-feeds GPL open source project.

[...]

Here is the summary with links:
- net: ethernet: mtk_wed: increase WED v2 WDMA RESV_BUFF to 0x80

    https://git.kernel.org/netdev/net/c/c0ef04232f9f

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html