🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #20483

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

#20483
From: Nicolai Buchwitz
Date: Sun, 22 Nov 2026 17:53
62 lines
10617 bytes
Hi Jakob

On 20.11.2026 15:16, Jakob Unterwurzacher wrote:
> From: Jakob Unterwurzacher <jakob.unterwurzacher@cherry.de>
> 
> 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
Technical Details
Message-ID: <b3f78ebb57866c32046ccc60c92928cb@tipi-net.de>
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-368776-linux-kernel-netdev=dewy.ru
References: <20261120-stmmac_dma_fatal_error-v1-1-acd57921af57@cherry.de>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-368776-linux-kernel-netdev=dewy.ru
From: nb@tipi-net.de (Nicolai Buchwitz)
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH] net: stmmac: reset the DMA on a fatal bus error
Date: Sun, 22 Nov 2026 18:53:03 +0100
Organization: Usenet Network
Message-ID: <b3f78ebb57866c32046ccc60c92928cb@tipi-net.de>
References: <20261120-stmmac_dma_fatal_error-v1-1-acd57921af57@cherry.de>
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII;
 format=flowed
Content-Transfer-Encoding: 7bit
Injection-Info: usenet.network;
	logging-data="3690542"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:6XVys78m7UnnjfJhmjBgcAPMgAE= sha256:HxXxr7yfdkXgpMa1re+p7Z/bERWQlkXCgeXZDiNFCj0=
	sha1:IOMb1sG6MW23EXiw1thU3DT87Z8= sha256:pa5/hzFS42dtU3OgnuKTJF8OkIkkoHQcmbIyOej8i3M=
List-ID: <netdev.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1])
	by mail.dewy.ru (Postfix) with ESMTP id AE222125D81; Sun, 22 Nov 2026 20:53:30 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.05
X-Spam-Status: No, score=-3.05 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=0.1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1,
	DKIM_VALID_AU=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.249,
	MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001,
	SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key)
	header.d=tipi-net.de
X-Received: from mail.dewy.ru ([127.0.0.1])
	by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id x_jFh1njHmBb;
	Sun, 22 Nov 2026 20:53:22 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-368776-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=none (p=none dis=none) header.from=tipi-net.de
X-Received: from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114])
	by mail.dewy.ru (Postfix) with ESMTPS id 47C77125D80; Sun, 22 Nov 2026 20:53:13 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by tor.lore.kernel.org (Postfix) with ESMTP id 5446929E40; Sun, 22 Nov 2026 17:53:12 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
	t=1795369991;
	b=Nh89pbssHGi5Bo4h1hXx58WL2vR2Tzfz/GC5eS/pFFavsvwVnJUwS9nstS/RLEZDLo0B
	 5it6xN8r8K3nGFR5KyemFxe7SU9PrYEvPCVeMxCxyS210gds1CxzEcKV1b0twczEQdu62
	 Z6M8K+DNDpk+IOh5QdSD9UiT450qp7GlMHRagt+bcWo+y4/wMsOtW9X55nTDygUjChYJ5
	 b+MaDWQGI5ZJDxvFqA4bv6rFcmrMTew0jTy0uWCBR9JDniuGremzXeg5+muyoKfpep68s
	 0v5+7vOEY6Ilz4vhCqGF9dVeYWxmQO7gWjzkDZOsCFuob+conywpQhDNetWCVwEbNxA==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1795369991;
	h=X-Original-To:Received:DMARC-Filter:Received:DKIM-Signature:
	 X-Mailing-List:List-Id:List-Post:List-Help:List-Subscribe:
	 List-Unsubscribe:List-Owner:Precedence:MIME-Version:Date:From:To:Cc:
	 Subject:In-Reply-To:References:Message-ID:X-Sender:Content-Type:
	 Content-Transfer-Encoding:X-Last-TLS-Session-Version;
	bh=roV1y4HiOD8riMt7NYik460JFDeSI4MlS3WQXSzighw=;
	b=KJtCFDAFrieYsr9jPgsupFgSjIaoxciELM5hYZBKufGEQxzNLrzAFwql1TUfsoo+8IWt
	 5lUFnMmGZekp4e14m240Mr+fJuJRBwvo2yKPVf1PJHfSJODMZp56l728Dhzk4bFicLdLj
	 emDD8S+TM/39HTT71I5kkWoktRlSViT9bhpWZZsgkMBM2g6CDD+/A3rDll2wYft+wwWRf
	 +1y2ifIx2bdHVHf2Xh60MjITa7U4U06sopJVpFlQibpOS9wTST6GAeNI0cxOQqbbqGB2I
	 K/fzeakhZzA2dT6sxSKIkO9VDC8k3H3ud6CoxKSifPAyETa66KVsIVr2EjuuGD2p5+g==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=tipi-net.de header.i=@tipi-net.de header.a=rsa-sha256 header.s=dkim header.b=X9dW6HlN;
	dmarc=none header.from=tipi-net.de;
	spf=pass smtp.mailfrom=tipi-net.de;
	arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-Received: from localhost.localdomain (localhost [127.0.0.1])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id C4519606A339;
	Sun, 22 Nov 2026 17:53:11 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=tipi-net.de header.i=@tipi-net.de header.a=rsa-sha256 header.s=dkim header.b=X9dW6HlN
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=194.13.80.246
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1795369991;
	b=n21e3OkChYK0zWHepoUgMQ4PYDr05j6cY1iapQEKZtIhlOxmM8bRTspSXMRel1vYCOW6
	 QTBlLv0QAenqHZMDY5Boak9HqrUqx3Qbham63azv88FK/uaQu/Ix2HElZK7VyYUQnZ3ql
	 nR/NjqFkQigGwnDKplNeINd0s1ry9TFhmCrV1QOH4Hi9YVsy4805RPMtEy8EP9TdqHGos
	 +HfuxJRRxDmmJIQdFI/gZOE2SrBxP/hmPGtvjGdfHQw+BLAzHj6e6DCNPNwWwsMt/0sBJ
	 A4UtjpX5KyMXbGBlU10ez6a2iIkN91S1bFtmNsNtD9v7trTtnBdbBm/Fc9A5Q61ozOg==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1795369991;
	h=DMARC-Filter:Received:DKIM-Signature:MIME-Version:Date:From:To:Cc:
	 Subject:In-Reply-To:References:Message-ID:X-Sender:Content-Type:
	 Content-Transfer-Encoding:X-Last-TLS-Session-Version;
	bh=roV1y4HiOD8riMt7NYik460JFDeSI4MlS3WQXSzighw=;
	b=TH8O6WM0ti1wAd87dBLrNMzhskwQVw8aDHiOjnL1wb48CWt/1Iak0dwrnOqDfSuSC7oU
	 aVi0s6eEIX1btWYn33JOKwRwCdU8CIpssZ7UQt26n8zCWWben2sO+k390isO+w/dUmSHx
	 YoenqebhGo9/K4zsuA9ZCWej/pTQx6PatF7DS8k45F2gxOSxdGpFsDlGvoOamD2WOsW4a
	 L6i9NGVlh/KsqdAga7Tc+ETKZWJsgJrCP4zBMoth4pU32YEcnWhEuaeveHG9PL5GEX+JW
	 YbEyWQumhH8gjE5vVGBUUZ1GN/tRwr+ZFdk485fU5Mnu+2g1C3gnEhOBM6LnoRFlLUg==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dmarc=none header.from=tipi-net.de;
	spf=pass smtp.mailfrom=tipi-net.de;
	dkim=pass header.d=tipi-net.de header.i=@tipi-net.de header.a=rsa-sha256 header.s=dkim header.b=X9dW6HlN;
	arc=none smtp.remote-ip=194.13.80.246
X-Received: from mail.tipi-net.de (mail.tipi-net.de [194.13.80.246])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256)
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9F243606A320;
	Sun, 22 Nov 2026 17:53:09 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 9F243606A320
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=tipi-net.de
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=tipi-net.de
X-Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 214D2A035D;
	Sun, 22 Nov 2026 18:53:03 +0100 (CET)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tipi-net.de; s=dkim;
	t=1795369987; h=from:subject:date:message-id:to:cc:mime-version:content-type:
	 content-transfer-encoding:in-reply-to:references;
	bh=roV1y4HiOD8riMt7NYik460JFDeSI4MlS3WQXSzighw=;
	b=X9dW6HlNjtTfX9kqmk/kpg/uFUJi1KufSMS35RCqxAYXBRngTtLx9ixLJdQVpsP8D6m+xa
	vvkVnG3xP5l1z+hZRkje0bRAGYWzMNQt57ZtC2+QfSBrVFCh4kTZvuHWvzA+zDPOuWz1Pm
	AuMUtd7zP2O66DIvLM8AE2nqsnMmQYd7k2N6m+ekxLRzZItd329n9A2FAyizovOEnBolNf
	uLJocbtMwS9bH5sSoRWwCp4R8ckLopuktYjLogMN5qrry+XR/XnpCKoUhMaOdm0ufUBYas
	b9DVeSKk4AlzV8ydg0CFOWMkViQBl7v+2pMsOnpswu0I6MSS8EX5RaTxelIgjQ==
X-Mailing-List: netdev@vger.kernel.org
X-List-Post: <mailto:netdev@vger.kernel.org>
X-List-Help: <mailto:netdev+help@vger.kernel.org>
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>
X-List-Owner: <mailto:netdev+owner@vger.kernel.org>
X-Precedence: list
X-Cc: Maxime Chevallier <maxime.chevallier@bootlin.com>, 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>, Maxime Coquelin <mcoquelin.stm32@gmail.com>, Alexandre
 Torgue <alexandre.torgue@foss.st.com>, jakob.unterwurzacher@cherry.de,
 netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com,
 linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org
X-In-Reply-To: <20261120-stmmac_dma_fatal_error-v1-1-acd57921af57@cherry.de>
X-Sender: nb@tipi-net.de
X-Last-TLS-Session-Version: TLSv1.3