From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796381272; b=5B0WbwLvm1j66IDY4pAGdXjJstMvVS7VDUVVM59JLPTBAn8q+tR/ObZ2MJp05iJtOQkY xIIhs4l+GMuZAs0AhxCTtUTPy518vC0kTpn2Eni7MzeFJKR27AaAx0Iu3ZhSVskYFBPdd QzUUZNF++Fqp3KKheaSfhID0WRTQtlQE0R1j8GhfnCLJx/F5bGLyxz2vG5il1Tf25fyC3 o9WRVdMniD8OCNKsKNnsEGFWLJGlua1BYGWvEJYhzRTEo51ZEq0TgF7Oz8hWAYV17oPHr 6Oo5dHOK2V80zJ6iyCafBsS8YMjNuX+VIIsJ9dXTGDcbPiobpfhSz6ZN6f7w4u8E9CQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796381272; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:User-Agent:X-stable:X-Patchwork-Hint: MIME-Version:Content-Transfer-Encoding; bh=r8TokGgODkwxIIZmLz+JIUq+2Q1BkvCXN2/eFp+rfI8=; b=uVjIieKusQroDIcEYPTKkPIswY8RePhM9dywaOTPd3BSb0ztB5gfI0FNT8czjZrJP1OD AF7jPm6ZDKBIi3mQ+p/rGH2C6bGGBHuesMfYU4WHRHdKGZNGBdCU2gZN1YNXrR5vJygeO uXSLsQxIwNuTC8Nb0P6sKxEI/TJN8cx3Y16DzVi4whaqq5k7wAlRO4rNxlGunAWI2fD8W 8cYjWbGSdUFQ47eepP+/NG3A4SgdCx2dvjQqbzYZTTJUBGL1lAE/3VslW1HPjANt/RS8x XUZNpaU9Q6xCXeTUdsAPctBuvBQ2f9KREVBA/H9Hs98yJQbjrcZdf30h46Jzj59aK3w== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=qc35DZw9; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 17841606A322; Fri, 4 Dec 2026 10:47:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=qc35DZw9 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3FED91F00931; Fri, 4 Dec 2026 10:47:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796381271; bh=r8TokGgODkwxIIZmLz+JIUq+2Q1BkvCXN2/eFp+rfI8=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=qc35DZw9wY6CjslggIWoadIiRXM4L91ErCkWN/4iHgqWHtds3ywZ/Smic62HlX6fw BKEVGjigMvRu8kLvZNH4UL5lVjZOgzxHzMZ+lhc3q9CQvmzItleuWex9PtM5k47hLF JIUNDtbOxMPk2L2TaMQCTAN8j2fMjmn4VRowYn78= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Zxyan Zhu , Maxime Chevallier , Nicolai Buchwitz , Jakub Kicinski Subject: [PATCH 7.3 633/742] net: stmmac: re-enable on-chip parity checkers for XGMAC ASP 0x2 Date: Fri, 4 Dec 2026 19:08:17 +0900 Message-ID: <20261204100651.910737832@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100635.034361255@linuxfoundation.org> References: <20261204100635.034361255@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: patches@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 7.3-stable review patch. If anyone has any objections, please let me know. ------------------ From: Zxyan Zhu commit 9c9863f9b9f120b771a908849157791a32eadb02 upstream. Commit 669a55560e4b ("net: stmmac: Check more MAC HW features for XGMAC Core 3.20") made dwxgmac3_safety_feat_config() bail out early for asp == 0x2, assuming that configuration has no parity protection. Per the DWC_xgmac databook, the ASP field of MAC_HW_Feature3 selects: 0x1 (AS_EPPE): all automotive safety features, with ECC and parity ports on the external application interface 0x2 (AS_NEPPE): all automotive safety features, without ECC or parity ports on the external application interface 0x3 (AS_PPE): all automotive safety features, with parity ports on the external application interface The reset value of the field is defined as: (DWCXG_ASP_ALL && DWCXG_ASP_PPE == 1) ? "3" : (DWCXG_ASP_ALL && DWCXG_ASP_PPE == 0) ? "2" : (DWCXG_ASP_ALL && DWCXG_ASP_PPE == 2) ? "1" : "0" so ASP 0x2 implies DWCXG_ASP_ALL = 1, where the internal FSM state parity and timeout (MAC_FSM_Control) and the on-chip data-path parity (MTL_DPP_CONTROL) features exist; only the ports on the external application interface are absent. The early return therefore skips enabling safety checkers that are present in the hardware. Drop 0x2 from the condition so the FSM and data-path parity checkers are enabled again. Also update the safety feature descriptions printed by stmmac_dma_cap_show() to spell out that ASP 0x1/0x2/0x3 differ only in the ECC or parity ports on the external application interface; the previous wording, "All Safety Features without ECC or Parity", suggests the on-chip checkers are absent from an ASP 0x2 device. Keep the early return for ASP 0x4 (EASP), which selects only ECC protection for external memory and has no on-chip parity features. Tested on XGMAC 3.10 and 3.40 cores. Fixes: 669a55560e4b ("net: stmmac: Check more MAC HW features for XGMAC Core 3.20") Cc: stable@vger.kernel.org Signed-off-by: Zxyan Zhu Reviewed-by: Maxime Chevallier Reviewed-by: Nicolai Buchwitz Link: https://patch.msgid.link/20261114015554.2187341-1-zxyan0222@gmail.com Signed-off-by: Jakub Kicinski Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c | 6 +++--- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) --- a/drivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c @@ -859,10 +859,10 @@ dwxgmac3_safety_feat_config(void __iomem value |= XGMAC_TCEIE; /* TSO Memory Correctable Error */ writel(value, ioaddr + XGMAC_DMA_ECC_INT_ENABLE); - /* 0x2: Without ECC or Parity Ports on External Application Interface - * 0x4: Only ECC Protection for External Memory feature is selected + /* 0x4: Only ECC Protection for External Memory feature is + * selected, without any on-chip parity protection */ - if (asp == 0x2 || asp == 0x4) + if (asp == 0x4) return 0; /* 4. Enable Parity and Timeout for FSM */ --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c @@ -6699,9 +6699,9 @@ static int stmmac_dma_cap_show(struct se }; static const char * const dwxgmac_safety_feature_desc[] = { "No", - "All Safety Features with ECC and Parity", - "All Safety Features without ECC or Parity", - "All Safety Features with Parity Only", + "All Safety Features with ECC and Parity Ports on External Application Interface", + "All Safety Features without ECC or Parity Ports on External Application Interface", + "All Safety Features with Parity Ports on External Application Interface", "ECC Only", "UNDEFINED", "UNDEFINED",