* [PATCH net v1] net: fec: ERR007885 Workaround for conventional TX
@ 2025-04-29 9:08 mattiasbarthel
2025-04-29 11:54 ` Andrew Lunn
2025-05-01 14:20 ` patchwork-bot+netdevbpf
0 siblings, 2 replies; 3+ messages in thread
From: mattiasbarthel @ 2025-04-29 9:08 UTC (permalink / raw)
To: wei.fang, shenwei.wang, xiaoning.wang, andrew+netdev, davem,
edumazet, kuba, pabeni, troy.kisky
Cc: imx, netdev, linux-kernel, Mattias Barthel
From: Mattias Barthel <mattias.barthel@atlascopco.com>
Activate TX hang workaround also in
fec_enet_txq_submit_skb() when TSO is not enabled.
Errata: ERR007885
Symptoms: NETDEV WATCHDOG: eth0 (fec): transmit queue 0 timed out
commit 37d6017b84f7 ("net: fec: Workaround for imx6sx enet tx hang when enable three queues")
There is a TDAR race condition for mutliQ when the software sets TDAR
and the UDMA clears TDAR simultaneously or in a small window (2-4 cycles).
This will cause the udma_tx and udma_tx_arbiter state machines to hang.
So, the Workaround is checking TDAR status four time, if TDAR cleared by
hardware and then write TDAR, otherwise don't set TDAR.
Fixes: 53bb20d1faba ("net: fec: add variable reg_desc_active to speed things up")
Signed-off-by: Mattias Barthel <mattias.barthel@atlascopco.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 a86cfebedaa8..17e9bddb9ddd 100644
--- a/drivers/net/ethernet/freescale/fec_main.c
+++ b/drivers/net/ethernet/freescale/fec_main.c
@@ -714,7 +714,12 @@ static int fec_enet_txq_submit_skb(struct fec_enet_priv_tx_q *txq,
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.43.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH net v1] net: fec: ERR007885 Workaround for conventional TX
2025-04-29 9:08 [PATCH net v1] net: fec: ERR007885 Workaround for conventional TX mattiasbarthel
@ 2025-04-29 11:54 ` Andrew Lunn
2025-05-01 14:20 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: Andrew Lunn @ 2025-04-29 11:54 UTC (permalink / raw)
To: mattiasbarthel
Cc: wei.fang, shenwei.wang, xiaoning.wang, andrew+netdev, davem,
edumazet, kuba, pabeni, troy.kisky, imx, netdev, linux-kernel,
Mattias Barthel
On Tue, Apr 29, 2025 at 11:08:26AM +0200, mattiasbarthel@gmail.com wrote:
> From: Mattias Barthel <mattias.barthel@atlascopco.com>
>
> Activate TX hang workaround also in
> fec_enet_txq_submit_skb() when TSO is not enabled.
>
> Errata: ERR007885
>
> Symptoms: NETDEV WATCHDOG: eth0 (fec): transmit queue 0 timed out
>
> commit 37d6017b84f7 ("net: fec: Workaround for imx6sx enet tx hang when enable three queues")
> There is a TDAR race condition for mutliQ when the software sets TDAR
> and the UDMA clears TDAR simultaneously or in a small window (2-4 cycles).
> This will cause the udma_tx and udma_tx_arbiter state machines to hang.
>
> So, the Workaround is checking TDAR status four time, if TDAR cleared by
> hardware and then write TDAR, otherwise don't set TDAR.
>
> Fixes: 53bb20d1faba ("net: fec: add variable reg_desc_active to speed things up")
> Signed-off-by: Mattias Barthel <mattias.barthel@atlascopco.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Andrew
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH net v1] net: fec: ERR007885 Workaround for conventional TX
2025-04-29 9:08 [PATCH net v1] net: fec: ERR007885 Workaround for conventional TX mattiasbarthel
2025-04-29 11:54 ` Andrew Lunn
@ 2025-05-01 14:20 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2025-05-01 14:20 UTC (permalink / raw)
To: None
Cc: wei.fang, shenwei.wang, xiaoning.wang, andrew+netdev, davem,
edumazet, kuba, pabeni, troy.kisky, imx, netdev, linux-kernel,
mattias.barthel
Hello:
This patch was applied to netdev/net.git (main)
by Jakub Kicinski <kuba@kernel.org>:
On Tue, 29 Apr 2025 11:08:26 +0200 you wrote:
> From: Mattias Barthel <mattias.barthel@atlascopco.com>
>
> Activate TX hang workaround also in
> fec_enet_txq_submit_skb() when TSO is not enabled.
>
> Errata: ERR007885
>
> [...]
Here is the summary with links:
- [net,v1] net: fec: ERR007885 Workaround for conventional TX
https://git.kernel.org/netdev/net/c/a179aad12bad
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] 3+ messages in thread
end of thread, other threads:[~2025-05-01 14:19 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-29 9:08 [PATCH net v1] net: fec: ERR007885 Workaround for conventional TX mattiasbarthel
2025-04-29 11:54 ` Andrew Lunn
2025-05-01 14: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;
as well as URLs for NNTP newsgroup(s).