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=1796384048; b=MoZYRAGAFFjrbTr0EaxGGwqF6Y/ZxR90fhVLOQsqH2igxgphsIU9Df9cdoXof32drD8x 6NAPmgB5+3iAeT0T4T5R9seN21hHFanWamHYYwpcwYfJnvy0OPIzxrqsxajYKkzzgsdfF nnQOMz5RnuGJiwcTopEYlak/ra8kiRLJJSXrKJBF5RzY8v5xHSl+WsTLNt+ms0Pv3CG0y NFvjWuhhYp+ZTHCe0mFEdskG9dz+rOHq5PAB6umr2FrkcBnLpyYwJ/2CbYrAESPAxd/R2 h9d9I7BsmiZ0iaEkfJiC54UVSRCqwTGD0f8HxNORN+9CqON0L3oxdxahmMB0Mj/yjXw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796384048; 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=4BNY9AUNjB4ITIMcDDRrBZNqptHCfOcCtLHjH0pB4cA=; b=h4hNhOqT0kL3r5Zsby1+C8nGaUy/6N3sHjvQyXKC318ivDJMTvA1oboNTAS+VixpFDp+ JQdbrzHkNSxZz8/ap7fHDEuSwkzQwcKOR81LLPbsjNC5lOhdpfOI/x5vm5z+2KMigE1T/ SX0KLjTUkYSirLzr1PF37McMJV6gxKkHP+1oHVONErng3BesUJFIKjfvxEfMZBoz0bx/K 8B4WUm44Tz3ofneOln1T99OFcK7+4Gk5RkNuDb1S39fusaWIBs4eAe8Shts6zHh/nZnja U3+eCk9PmGTWlKPc4lI9vfqVTTr05DzANVd31IiWffTqj+6rHJtzsLDKHfXonVsK2Xg== 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=SwkhHRt6; 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 F32F7606A32C; Fri, 4 Dec 2026 11:34:07 +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=SwkhHRt6 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 186201F00897; Fri, 4 Dec 2026 11:34:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796384047; bh=4BNY9AUNjB4ITIMcDDRrBZNqptHCfOcCtLHjH0pB4cA=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=SwkhHRt65tqvzv577LwxDyQkfdqBjcxcIHe2P+FWkwTvsY7NZ1+Yl+uA8IUUzGoR1 U4lLxh9RkEBQr1ChXWD1HU8p5Hb+4eP6ZAEGu+Z+3VhPyy9u8gH3oy3SDsq/MBWF2D vKygRhFbDt9CkicXTdwzLmNLLZZRoJhlAJh4MYGE= 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 6.12 474/555] net: stmmac: re-enable on-chip parity checkers for XGMAC ASP 0x2 Date: Fri, 4 Dec 2026 19:08:37 +0900 Message-ID: <20261204100627.302154170@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100603.988357525@linuxfoundation.org> References: <20261204100603.988357525@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 6.12-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 @@ -937,10 +937,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 @@ -6462,9 +6462,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",