Commit a179aad1 authored by Mattias Barthel's avatar Mattias Barthel Committed by Jakub Kicinski
Browse files

net: fec: ERR007885 Workaround for conventional TX



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 37d6017b ("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: 53bb20d1 ("net: fec: add variable reg_desc_active to speed things up")
Signed-off-by: default avatarMattias Barthel <mattias.barthel@atlascopco.com>
Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
Link: https://patch.msgid.link/20250429090826.3101258-1-mattiasbarthel@gmail.com


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 2d52e2e3
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -714,6 +714,11 @@ static int fec_enet_txq_submit_skb(struct fec_enet_priv_tx_q *txq,
	txq->bd.cur = bdp;

	/* Trigger transmission start */
	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;