[PATCH net-next 01/13] net: ethernet: mtk_eth_soc: reset PDMA TX completion index on ring setup

From: Ho Jie Feng

Date: Sat Dec 05 2026 - 12:22:31 EST


mtk_poll_tx_pdma() resumes from ring->cpu_idx, and that field is only
ever written by the poll function itself. mtk_tx_alloc() resets the
hardware CPU and DMA indices of a new PDMA ring, but leaves the software
cursor at the value it had when the previous ring was torn down.

Start the software cursor at descriptor zero together with the hardware
indices.

Fixes: 296c9120752b ("net: ethernet: mediatek: Add MT7628/88 SoC support")
Link: https://github.com/dormancygrace/net-next/commit/c865cc487e7008aabd7a6616be5515b7541a657d
Signed-off-by: Ho Jie Feng <hjf3108@xxxxxxxxx>
---
drivers/net/ethernet/mediatek/mtk_eth_soc.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.c b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
index 21abeccfe0..e4b703a79d 100644
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
@@ -2749,6 +2749,7 @@ static int mtk_tx_alloc(struct mtk_eth *eth)
if (mtk_is_netsys_v2_or_greater(eth))
mtk_w32(eth, val, soc->reg_map->qdma.tx_sch_rate + 4);
} else {
+ ring->cpu_idx = 0;
mtk_w32(eth, ring->phys_pdma, MT7628_TX_BASE_PTR0);
mtk_w32(eth, ring_size, MT7628_TX_MAX_CNT0);
mtk_w32(eth, 0, MT7628_TX_CTX_IDX0);
--
2.53.0