Linux kernel -stable discussions
 help / color / mirror / Atom feed
From: Nicolai Buchwitz <nb@tipi-net.de>
To: Zxyan Zhu <zxyan0222@gmail.com>
Cc: maxime.chevallier@bootlin.com, andrew+netdev@lunn.ch,
	davem@davemloft.net, edumazet@kernel.org, kuba@kernel.org,
	pabeni@redhat.com, mcoquelin.stm32@gmail.com,
	alexandre.torgue@foss.st.com, horms@kernel.org, 0x1207@gmail.com,
	netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, stable@vger.kernel.org
Subject: Re: [PATCH net] net: stmmac: re-enable on-chip parity checkers for XGMAC ASP 0x2
Date: Tue, 17 Nov 2026 10:26:01 +0100	[thread overview]
Message-ID: <e041744a3817153bfe5269053d0a9260@tipi-net.de> (raw)
In-Reply-To: <20261114015554.2187341-1-zxyan0222@gmail.com>

On 14.11.2026 02:55, Zxyan Zhu wrote:
> 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 <zxyan0222@gmail.com>
> ---
>  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(-)
> 
> diff --git a/drivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c 
> b/drivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c
> index 1a88cbaed70c..6b2bfc241109 100644
> --- 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 *ioaddr, 
> unsigned int asp,
>  	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 */
> diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c 
> b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> index 25894771e9e9..24f887df88fa 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> @@ -6741,9 +6741,9 @@ static int stmmac_dma_cap_show(struct seq_file 
> *seq, void *v)
>  	};
>  	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",

Reviewed-by: Nicolai Buchwitz <nb@tipi-net.de>

Thanks,
Nicolai

      parent reply	other threads:[~2026-11-17  9:26 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-14  1:55 [PATCH net] net: stmmac: re-enable on-chip parity checkers for XGMAC ASP 0x2 Zxyan Zhu
2026-11-14  1:58 ` netdev-bot+sinfo
2026-11-14  2:33   ` zhu xin
2026-11-17  9:12 ` Maxime Chevallier
2026-11-17  9:26 ` Nicolai Buchwitz [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e041744a3817153bfe5269053d0a9260@tipi-net.de \
    --to=nb@tipi-net.de \
    --cc=0x1207@gmail.com \
    --cc=alexandre.torgue@foss.st.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@kernel.org \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-stm32@st-md-mailman.stormreply.com \
    --cc=maxime.chevallier@bootlin.com \
    --cc=mcoquelin.stm32@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=stable@vger.kernel.org \
    --cc=zxyan0222@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox