Re: [PATCH] net: stmmac: reset the DMA on a fatal bus error

From: Nicolai Buchwitz

Date: Sun Nov 22 2026 - 12:53:16 EST


Hi Jakob

On 20.11.2026 15:16, Jakob Unterwurzacher wrote:
From: Jakob Unterwurzacher <jakob.unterwurzacher@xxxxxxxxx>

A fatal bus error (FBE) stops both the TX and the RX DMA engine of the
channel. The DMA interrupt handlers report it as tx_hard_error, so
stmmac_tx_err() reinitializes and restarts the TX side only.

Does it? AFAIU stmmac_tx_err() only runs when status is exactly tx_hard_error.

[...]

Since you hit this on real hardware, please add a Fixes tag. Also your subject
lacks the target tree (would be net for a fix). See [1]

[1] https://docs.kernel.org/process/maintainer-netdev.html#indicating-target-tree

[...]

diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac4_lib.c b/drivers/net/ethernet/stmicro/stmmac/dwmac4_lib.c
index a0249715fafaf..2147403629892 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac4_lib.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac4_lib.c
@@ -165,7 +165,7 @@ int dwmac4_dma_interrupt(struct stmmac_priv *priv, void __iomem *ioaddr,
}
if (unlikely(intr_status & DMA_CHAN_STATUS_FBE)) {
x->fatal_bus_error_irq++;
- ret = tx_hard_error;
+ ret |= dma_fatal_error;

stmmac_dma_err_interrupt() still checks for tx_hard_error (see 686b5f47f8cc),
so this breaks the FBE reset. The flag needs to be handled there too.

[...]

diff --git a/drivers/net/ethernet/stmicro/stmmac/dwxgmac2_dma.c b/drivers/net/ethernet/stmicro/stmmac/dwxgmac2_dma.c
index 0a6e82a155c0e..bc06076410dc7 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwxgmac2_dma.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwxgmac2_dma.c
@@ -335,7 +335,7 @@ static int dwxgmac2_dma_interrupt(struct stmmac_priv *priv,
}
if (unlikely(intr_status & XGMAC_FBE)) {
x->fatal_bus_error_irq++;
- ret |= tx_hard_error;
+ ret |= dma_fatal_error;

AFAIU xgmac doesn't enable FBE, so this never fires?

[...]

Regards,
Nicolai