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=1796382680; b=xNltckTUbOlNMDnQhFsIgOEDqy3sCXWWS2ReOIDN5PHijCBGuijfCHd9oPqUoUIhYka5 6j2QsYlAcXQB1FVpNWyYHrPZ/YwPrILUyakN+O/oqUwXjK8LKFj2efN5Vzkcfcl3J4zPO Yg/EwzV7qoN9l4oeq9SNnojPQ9CGBmUDJInFGzG/TjDE3ailfZRrngCufBOWezG+2sYyy TM1rz2+R/EH5XGfPXOigtAcabZjj/GZ/RQoH86iNR+j+o6wxcFjL5hSQkQ1CBMsJQTPBn HO1HKsGot3rB/x9QbI8VPKTrb4rSKyjEc1YW7RIvqhCbGHMiggDnFY25al+timlj/fQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796382680; 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=DZs8SaEQqXvNojXajfIRSDypzd2YKGtc/GHy3rwnMG4=; b=GSAIcKVXUj/IDKblhFxX9/aG4dI/6GkFZRZYfKvVpuaE2hdMUJSmq3hhxMIyoHrjXxTt o0xKqiw/fHUst4ISxmiH1rSS8rC6N6GpzDe+TAq9LRcpId0ke4vGkNC/g52jviU3D7QV4 fXF8mKZ6tArrnYnbv0dPzk2gJH2pJCHx30FDKsimpg0DSiePT1KC5iE3GULfGnuvdFKcH RO6UqEm2pj9AwJ/zENfNvV1bzfrN8zNWiF/j2olcaTFyXduH9mSu0HeqYRaieuFGn3c3Y 8q76PtyVhRpEhHTcS/ca5DG5Xq3a/+Dv3OcOk/UDCDKqWVxE5xTla/fWhmR70XYlA4A== 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=zO8t6XFa; 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 85FFC606A322; Fri, 4 Dec 2026 11:11:20 +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=zO8t6XFa Received: by smtp.kernel.org (Postfix) with ESMTPSA id EED2D1F00897; Fri, 4 Dec 2026 11:11:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796382680; bh=DZs8SaEQqXvNojXajfIRSDypzd2YKGtc/GHy3rwnMG4=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=zO8t6XFa2FHhtHxyBWE4Ng4CDfnWx1RqkoMl7BwR/8KMb7W0NlMSHpS2586VgS/ow qPcXemo2OefQycLBY64+eBw8g4xU80ZUEaCgBSzBbGRNlPfSTfK6TjzARp0pNut7ya nh+BaD37CAs27e6JCcLAYjoVeg8YdMKuIhwSJwsY= 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.18 558/703] net: stmmac: re-enable on-chip parity checkers for XGMAC ASP 0x2 Date: Fri, 4 Dec 2026 19:07:37 +0900 Message-ID: <20261204100642.623566910@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100627.522266145@linuxfoundation.org> References: <20261204100627.522266145@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.18-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 @@ -868,10 +868,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 @@ -6476,9 +6476,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",