* [PATCH net] net: fec: ERR007885 Workaround for XDP TX path
@ 2025-11-28 2:59 Wei Fang
2025-12-04 8:53 ` Paolo Abeni
2025-12-04 9:20 ` patchwork-bot+netdevbpf
0 siblings, 2 replies; 4+ messages in thread
From: Wei Fang @ 2025-11-28 2:59 UTC (permalink / raw)
To: shenwei.wang, xiaoning.wang, andrew+netdev, davem, edumazet, kuba,
pabeni
Cc: imx, netdev, linux-kernel
The ERR007885 will lead to a TDAR race condition for mutliQ when the
driver sets TDAR and the UDMA clears TDAR simultaneously or in a small
window (2-4 cycles). And it will cause the udma_tx and udma_tx_arbiter
state machines to hang. Therefore, the commit 53bb20d1faba ("net: fec:
add variable reg_desc_active to speed things up") and the commit
a179aad12bad ("net: fec: ERR007885 Workaround for conventional TX") have
added the workaround to fix the potential issue for the conventional TX
path. Similarly, the XDP TX path should also have the potential hang
issue, so add the workaround for XDP TX path.
Fixes: 6d6b39f180b8 ("net: fec: add initial XDP support")
Signed-off-by: Wei Fang <wei.fang@nxp.com>
---
drivers/net/ethernet/freescale/fec_main.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c
index 3222359ac15b..e2b75d1970ae 100644
--- a/drivers/net/ethernet/freescale/fec_main.c
+++ b/drivers/net/ethernet/freescale/fec_main.c
@@ -3948,7 +3948,12 @@ static int fec_enet_txq_xmit_frame(struct fec_enet_private *fep,
txq->bd.cur = bdp;
/* Trigger transmission start */
- writel(0, txq->bd.reg_desc_active);
+ if (!(fep->quirks & FEC_QUIRK_ERR007885) ||
+ !readl(txq->bd.reg_desc_active) ||
+ !readl(txq->bd.reg_desc_active) ||
+ !readl(txq->bd.reg_desc_active) ||
+ !readl(txq->bd.reg_desc_active))
+ writel(0, txq->bd.reg_desc_active);
return 0;
}
--
2.34.1
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [PATCH net] net: fec: ERR007885 Workaround for XDP TX path
2025-11-28 2:59 [PATCH net] net: fec: ERR007885 Workaround for XDP TX path Wei Fang
@ 2025-12-04 8:53 ` Paolo Abeni
2025-12-04 9:10 ` Wei Fang
2025-12-04 9:20 ` patchwork-bot+netdevbpf
1 sibling, 1 reply; 4+ messages in thread
From: Paolo Abeni @ 2025-12-04 8:53 UTC (permalink / raw)
To: Wei Fang, shenwei.wang, xiaoning.wang, andrew+netdev, davem,
edumazet, kuba
Cc: imx, netdev, linux-kernel
On 11/28/25 3:59 AM, Wei Fang wrote:
> The ERR007885 will lead to a TDAR race condition for mutliQ when the
> driver sets TDAR and the UDMA clears TDAR simultaneously or in a small
> window (2-4 cycles). And it will cause the udma_tx and udma_tx_arbiter
> state machines to hang. Therefore, the commit 53bb20d1faba ("net: fec:
> add variable reg_desc_active to speed things up") and the commit
> a179aad12bad ("net: fec: ERR007885 Workaround for conventional TX") have
> added the workaround to fix the potential issue for the conventional TX
> path. Similarly, the XDP TX path should also have the potential hang
> issue, so add the workaround for XDP TX path.
>
> Fixes: 6d6b39f180b8 ("net: fec: add initial XDP support")
> Signed-off-by: Wei Fang <wei.fang@nxp.com>
> ---
> drivers/net/ethernet/freescale/fec_main.c | 7 ++++++-
> 1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c
> index 3222359ac15b..e2b75d1970ae 100644
> --- a/drivers/net/ethernet/freescale/fec_main.c
> +++ b/drivers/net/ethernet/freescale/fec_main.c
> @@ -3948,7 +3948,12 @@ static int fec_enet_txq_xmit_frame(struct fec_enet_private *fep,
> txq->bd.cur = bdp;
>
> /* Trigger transmission start */
> - writel(0, txq->bd.reg_desc_active);
> + if (!(fep->quirks & FEC_QUIRK_ERR007885) ||
> + !readl(txq->bd.reg_desc_active) ||
> + !readl(txq->bd.reg_desc_active) ||
> + !readl(txq->bd.reg_desc_active) ||
> + !readl(txq->bd.reg_desc_active))
> + writel(0, txq->bd.reg_desc_active);
>
> return 0;
> }
LGTM!
Side note for a net-next follow-up: please consider moving this logic in
a reusable helper, since you already have a few potentials call sites.
/P
^ permalink raw reply [flat|nested] 4+ messages in thread* RE: [PATCH net] net: fec: ERR007885 Workaround for XDP TX path
2025-12-04 8:53 ` Paolo Abeni
@ 2025-12-04 9:10 ` Wei Fang
0 siblings, 0 replies; 4+ messages in thread
From: Wei Fang @ 2025-12-04 9:10 UTC (permalink / raw)
To: Paolo Abeni, Shenwei Wang, Clark Wang, andrew+netdev@lunn.ch,
davem@davemloft.net, edumazet@google.com, kuba@kernel.org
Cc: imx@lists.linux.dev, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org
> On 11/28/25 3:59 AM, Wei Fang wrote:
> > The ERR007885 will lead to a TDAR race condition for mutliQ when the
> > driver sets TDAR and the UDMA clears TDAR simultaneously or in a small
> > window (2-4 cycles). And it will cause the udma_tx and udma_tx_arbiter
> > state machines to hang. Therefore, the commit 53bb20d1faba ("net: fec:
> > add variable reg_desc_active to speed things up") and the commit
> > a179aad12bad ("net: fec: ERR007885 Workaround for conventional TX") have
> > added the workaround to fix the potential issue for the conventional TX
> > path. Similarly, the XDP TX path should also have the potential hang
> > issue, so add the workaround for XDP TX path.
> >
> > Fixes: 6d6b39f180b8 ("net: fec: add initial XDP support")
> > Signed-off-by: Wei Fang <wei.fang@nxp.com>
> > ---
> > drivers/net/ethernet/freescale/fec_main.c | 7 ++++++-
> > 1 file changed, 6 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/net/ethernet/freescale/fec_main.c
> b/drivers/net/ethernet/freescale/fec_main.c
> > index 3222359ac15b..e2b75d1970ae 100644
> > --- a/drivers/net/ethernet/freescale/fec_main.c
> > +++ b/drivers/net/ethernet/freescale/fec_main.c
> > @@ -3948,7 +3948,12 @@ static int fec_enet_txq_xmit_frame(struct
> fec_enet_private *fep,
> > txq->bd.cur = bdp;
> >
> > /* Trigger transmission start */
> > - writel(0, txq->bd.reg_desc_active);
> > + if (!(fep->quirks & FEC_QUIRK_ERR007885) ||
> > + !readl(txq->bd.reg_desc_active) ||
> > + !readl(txq->bd.reg_desc_active) ||
> > + !readl(txq->bd.reg_desc_active) ||
> > + !readl(txq->bd.reg_desc_active))
> > + writel(0, txq->bd.reg_desc_active);
> >
> > return 0;
> > }
>
> LGTM!
>
> Side note for a net-next follow-up: please consider moving this logic in
> a reusable helper, since you already have a few potentials call sites.
>
Yes, I have already planned to add a helper after this patch is merged
into net-next tree. :)
> /P
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH net] net: fec: ERR007885 Workaround for XDP TX path
2025-11-28 2:59 [PATCH net] net: fec: ERR007885 Workaround for XDP TX path Wei Fang
2025-12-04 8:53 ` Paolo Abeni
@ 2025-12-04 9:20 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 4+ messages in thread
From: patchwork-bot+netdevbpf @ 2025-12-04 9:20 UTC (permalink / raw)
To: Wei Fang
Cc: shenwei.wang, xiaoning.wang, andrew+netdev, davem, edumazet, kuba,
pabeni, imx, netdev, linux-kernel
Hello:
This patch was applied to netdev/net.git (main)
by Paolo Abeni <pabeni@redhat.com>:
On Fri, 28 Nov 2025 10:59:15 +0800 you wrote:
> The ERR007885 will lead to a TDAR race condition for mutliQ when the
> driver sets TDAR and the UDMA clears TDAR simultaneously or in a small
> window (2-4 cycles). And it will cause the udma_tx and udma_tx_arbiter
> state machines to hang. Therefore, the commit 53bb20d1faba ("net: fec:
> add variable reg_desc_active to speed things up") and the commit
> a179aad12bad ("net: fec: ERR007885 Workaround for conventional TX") have
> added the workaround to fix the potential issue for the conventional TX
> path. Similarly, the XDP TX path should also have the potential hang
> issue, so add the workaround for XDP TX path.
>
> [...]
Here is the summary with links:
- [net] net: fec: ERR007885 Workaround for XDP TX path
https://git.kernel.org/netdev/net/c/e8e032cd24dd
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2025-12-04 9:23 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-28 2:59 [PATCH net] net: fec: ERR007885 Workaround for XDP TX path Wei Fang
2025-12-04 8:53 ` Paolo Abeni
2025-12-04 9:10 ` Wei Fang
2025-12-04 9:20 ` patchwork-bot+netdevbpf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox