Devicetree
 help / color / mirror / Atom feed
From: Ho Jie Feng <hjf3108@gmail.com>
To: Andrew Lunn <andrew+netdev@lunn.ch>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@kernel.org>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>, Felix Fietkau <nbd@nbd.name>,
	Lorenzo Bianconi <lorenzo@kernel.org>,
	Matthias Brugger <matthias.bgg@gmail.com>,
	AngeloGioacchino Del Regno
	<angelogioacchino.delregno@collabora.com>,
	Russell King <linux@armlinux.org.uk>
Cc: netdev@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-mediatek@lists.infradead.org,
	Gleb Pesin <dormancygrace@gmail.com>,
	Ho Jie Feng <hjf3108@gmail.com>
Subject: [PATCH net-next 01/13] net: ethernet: mtk_eth_soc: reset PDMA TX completion index on ring setup
Date: Sun,  6 Dec 2026 01:21:40 +0800	[thread overview]
Message-ID: <20261205172152.3142989-2-hjf3108@gmail.com> (raw)
In-Reply-To: <20261205172152.3142989-1-hjf3108@gmail.com>

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@gmail.com>
---
 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


  reply	other threads:[~2026-12-05 17:22 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-05 17:21 [PATCH net-next 00/13] net: ethernet: mtk_eth_soc: add support for RT3883 and related SoCs Ho Jie Feng
2026-12-05 17:21 ` Ho Jie Feng [this message]
2026-12-05 17:21 ` [PATCH net-next 02/13] net: ethernet: mtk_eth_soc: move PDMA TX ring registers to the register map Ho Jie Feng
2026-12-05 17:21 ` [PATCH net-next 03/13] net: ethernet: mtk_eth_soc: add a per-SoC TX done interrupt mask Ho Jie Feng
2026-12-05 17:21 ` [PATCH net-next 04/13] net: ethernet: mtk_eth_soc: complete PDMA TX on the right MAC Ho Jie Feng
2026-12-05 17:21 ` [PATCH net-next 05/13] dt-bindings: net: mediatek,net: fix the ralink,rt5350-eth constraints Ho Jie Feng
2026-12-05 17:21 ` [PATCH net-next 06/13] dt-bindings: net: mediatek,net: add ralink,rt3883-eth Ho Jie Feng
2026-12-05 17:21 ` [PATCH net-next 07/13] net: ethernet: mtk_eth_soc: use BIT_ULL() for the required clocks Ho Jie Feng
2026-12-05 17:21 ` [PATCH net-next 08/13] net: ethernet: mtk_eth_soc: add RT3883 support Ho Jie Feng
2026-12-05 17:21 ` [PATCH net-next 09/13] net: ethernet: mtk_eth_soc: allow building for RT5350 Ho Jie Feng
2026-12-05 17:21 ` [PATCH net-next 10/13] dt-bindings: net: mediatek,net: add ralink,rt2880-eth Ho Jie Feng
2026-12-05 17:21 ` [PATCH net-next 11/13] net: ethernet: mtk_eth_soc: add RT2880 support Ho Jie Feng
2026-12-05 17:21 ` [PATCH net-next 12/13] dt-bindings: net: mediatek,net: add ralink,rt3050-eth Ho Jie Feng
2026-12-05 17:21 ` [PATCH net-next 13/13] net: ethernet: mtk_eth_soc: add RT305x support Ho Jie Feng
2026-12-05 17:28 ` [PATCH net-next 00/13] net: ethernet: mtk_eth_soc: add support for RT3883 and related SoCs netdev-bot+sinfo
2026-12-05 17:49   ` Jie Feng

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261205172152.3142989-2-hjf3108@gmail.com \
    --to=hjf3108@gmail.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=angelogioacchino.delregno@collabora.com \
    --cc=conor+dt@kernel.org \
    --cc=davem@davemloft.net \
    --cc=devicetree@vger.kernel.org \
    --cc=dormancygrace@gmail.com \
    --cc=edumazet@kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=linux@armlinux.org.uk \
    --cc=lorenzo@kernel.org \
    --cc=matthias.bgg@gmail.com \
    --cc=nbd@nbd.name \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=robh@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox