🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #26210

Re: [PATCH net-next 2/2] net: stmmac: dwmac-socfpga: route the auxiliary snapshot trigger from the FPGA

#26210
From: netdev-bot+sashiko
Date: Thu, 03 Dec 2026 08:29
92 lines
11718 bytes
Thank you for your contribution! Sashiko AI review found 1 potential
issue(s) to consider.

Critical: 0 · High: 0 · Medium: 1 · Low: 0

If you believe none of the issues are legitimate, please reply to each
issue of Medium severity or higher and explain why the AI is wrong.
If any of them are legitimate and you plan to respin, please let patchwork
know by including "pw-bot: cr" as a separate line at the end of your reply
(one such reply per series is enough).

- [Medium] In socfpga_gen10_set_phy_mode()
  (drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c), the new…

--

net: stmmac: dwmac-socfpga: route the auxiliary snapshot trigger from the FPGA

On Agilex 5, this sets the ppstrig_sel bit in the EMAC's System Manager
tsn register when the device tree has altr,f2h-ptp-aux-trig, and clears
it otherwise. When the bit is set, auxiliary snapshot 1 is triggered from
the FPGA fabric instead of an HPS pin. The bit is written while the EMAC
is held in reset, in the same place the PHY mode is written.

> diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c
> index 4e0187ffe0d32..0a706624d2856 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c

[ ... ]

> @@ -481,6 +487,16 @@ static int socfpga_gen10_set_phy_mode(struct socfpga_dwmac *dwmac,
>  		ctrl &= ~SYSMGR_GEN10_EMACGRP_CTRL_PTP_REF_CLK_MASK;
>  	}
>  
> +	/* Take the trigger of auxiliary snapshot 1 from the FPGA fabric, or
> +	 * from the HPS I/O pin multiplexer
> +	 */
> +	if (dwmac->ops->has_ppstrig_sel) {
> +		if (dwmac->f2h_ptp_aux_trig)
> +			ctrl |= SYSMGR_AGILEX5_TSN_PPSTRIG_SEL;

[Severity: Medium]
Does the FPGA-to-EMAC interface gate also need to be opened when
f2h_ptp_aux_trig is set?

Earlier in socfpga_gen10_set_phy_mode(), only this block writes the
per-EMAC bit in SYSMGR_FPGAINTF_EMAC_REG:

	if (dwmac->f2h_ptp_ref_clk ||
	    phymode == PHY_INTERFACE_MODE_MII ||
	    phymode == PHY_INTERFACE_MODE_GMII ||
	    phymode == PHY_INTERFACE_MODE_SGMII) {
		ctrl |= SYSMGR_GEN10_EMACGRP_CTRL_PTP_REF_CLK_MASK;
		regmap_read(sys_mgr_base_addr, SYSMGR_FPGAINTF_EMAC_REG,
			    &module);
		module |= (SYSMGR_FPGAINTF_EMAC_BIT << reg_shift);
		regmap_write(sys_mgr_base_addr, SYSMGR_FPGAINTF_EMAC_REG,
			     module);
	} else {

The altr,socfpga-stmmac.yaml binding describes the altr,sysmgr-syscon
shift on Arria10/Stratix10/Agilex as the bit that "enable/disable
signals from the FPGA fabric to the EMAC modules". A trigger driven by
the fabric looks like one of those signals.

Take an Agilex 5 board with an RGMII or RMII PHY, no
altr,f2h_ptp_ref_clk, and altr,f2h-ptp-aux-trig set. The else branch
would run, so the gate is never opened. The trigger mux would still be
pointed at the FPGA.

Would external timestamp channel 1 then see no events, with no error
reported, unless the firmware had already opened the gate? The
f2h_ptp_ref_clk path always pairs the FPGA-sourced signal with opening
this gate. Should f2h_ptp_aux_trig be added to that condition as well?

I can't tell from the source whether the aux trigger line actually goes
through this gate. The DE25-Nano test may have passed because U-Boot or
ATF had already set the bit, so it doesn't settle the question either
way.

> +		else
> +			ctrl &= ~SYSMGR_AGILEX5_TSN_PPSTRIG_SEL;
> +	}
> +
>  	regmap_write(sys_mgr_base_addr, reg_offset, ctrl);

[ ... ]

-- 
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/cover.1796106489.git.jjc%40jclark.com
Technical Details
Message-ID: <179628657335.3146.8324183269390775648@kernel.org>
Path: mbox-mo1.pugleaf.net!news-lon.pugleaf.net!feed-eu-txt.newsdeef.eu!feed-eu-ch.newsdeef.eu!srl.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-376401-linux-kernel-netdev=dewy.ru
References: <c0bc9280fa492b03753d6eea686fe387e4373df5.1796106489.git.jjc@jclark.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lon.pugleaf.net!feed-eu-txt.newsdeef.eu!feed-eu-ch.newsdeef.eu!srl.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-376401-linux-kernel-netdev=dewy.ru
From: netdev-bot+sashiko@kernel.org
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net-next 2/2] net: stmmac: dwmac-socfpga: route the
 auxiliary snapshot trigger from the FPGA
Date: Thu, 03 Dec 2026 08:29:33 +0000
Organization: Usenet Network
Message-ID: <179628657335.3146.8324183269390775648@kernel.org>
References: <c0bc9280fa492b03753d6eea686fe387e4373df5.1796106489.git.jjc@jclark.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="2435371"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:TCmjCJ544ngmJDwqN5utFk4zPLk= sha256:YXzh9IPto+Ma5AVYgVVbh4Dl7VtEyyRRBfH0/PqXmqI=
	sha1:fM7/nzV508cawIr+1ssxam9ZP9c= sha256:xfSv6ETSSdALbX/HqEi6RQdE3CCs240oSsAW5RcOq+k=
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 5B3A5117880; Thu,  3 Dec 2026 11:29:56 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.401
X-Spam-Status: No, score=-3.401 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1,
	DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,
	MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001,
	SPF_PASS=-0.001] autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key)
	header.d=kernel.org
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 CUIOCQwW0Rza;
	Thu,  3 Dec 2026 11:29:49 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-376401-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=pass (p=quarantine dis=none) header.from=kernel.org
X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
	by mail.dewy.ru (Postfix) with ESMTPS id AE17511787B; Thu,  3 Dec 2026 11:29:38 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by sea.lore.kernel.org (Postfix) with ESMTP id 35CCE275F1; Thu,  3 Dec 2026 08:29:36 +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=1796286576;
	b=3HTQ7nw1VQq7qEOxjwimFE7U6xYLHdPspZLYg+pokvCWAEab/Afb61A6AWdHOYvby2v3
	 qNClS+ffCL8IfjwQxvQRDT+o6Xpa3rsQVzWNHs0YDAcPoSXoRayTADDOr9RlsUqKTIBgU
	 j8RDiD0I5a56g5bFpZYV1Vpr97lCQ+VeAzP0FgRMs2+v9cScayQBxKFolUA5jShTiaih7
	 19+VN/V9rXo4vhzKOfwThTWJ7ad79NBN9hDMYnZmjiABMIAJQJVQeyleQwLBvDn4LHouQ
	 gxz3alHrztgXaYQJiskZoqW68iCiJ8LrZwXj8w+3Mz+o5IM909eIWuFCnm+9QiqJ64Q==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1796286576;
	h=X-Original-To:Received:Received:DKIM-Signature:Subject:From:To:Cc:
	 Date:Message-ID:In-Reply-To:References:X-sashiko-severity:
	 Content-Type:Content-Transfer-Encoding:X-Mailing-List:List-Id:
	 List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner:
	 Precedence:MIME-Version;
	bh=XwIy3zsdNA5CPbMjfeaGgN4as3MANqVvK+TxzD77T6g=;
	b=mZh8LhrmCgtVg33tXzq1F7B0GIXpW/IzgjitW9Zo+z95MzTdy/hXz4Rrw0avxUr+Sae5
	 o8Afx0XEYjec7ltq+IxLRIRcL68GPyM71gQ6/uCHXtjgkpHJ2nV0z0za6u+XY1XJs3Mx2
	 O7CFKfVCa2vCAZfS36WSQTUiW3cpwPcc/IOiu4/6KGyOips48RmN8FM+egUo5kWvg+wwk
	 ZnOgeyjV0AdgnEBb/pQWmui57ge7LR3i7kd02+Gz/0jflBXjcwxaQDmmORsNMqoe9Wp8z
	 9hfWfL5oTb4e2R9ldoYmInrFITjavZR9BQ0T7spDyg/1LDvL1yzxcC3+KwBR0BzLdxQ==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=D3GGF77O;
	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 E80EB606A336;
	Thu,  3 Dec 2026 08:29:35 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=D3GGF77O
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1796286575;
	b=b1T+0u35vjgQbIzxmUFvzDJR3yBifuXm/Nqazi+IYVU9wBO2kVI1VfTrHzuLCR2u0RwO
	 wv9ErY6H8MNqF8gp2b/3L3AEGvVLWnK07wAara09ODIEWwcIHpP8uVCIDhQbi6EmKsrcJ
	 OROMFJhl6r3bC3de/yTpXYooswxSkm/aUNrWk+j9UuHgJnhotriUyW93BWV4QG7PYD1Kw
	 D+8dCmW5le5xjTp0CbuiYMVWK+qpbPjYIFAw9JAe6jF2vrSuG+u2EGBynoEU4812Uv045
	 9nTSgDSZmayV7fWIo0LsoC0bEJv8RYlFPbCsbeyYa925qIoyTPYBaZv1a3lpHZOCnVQ==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1796286575;
	h=Received:DKIM-Signature:Subject:From:To:Cc:Date:Message-ID:
	 In-Reply-To:References:X-sashiko-severity:Content-Type:
	 Content-Transfer-Encoding:MIME-Version;
	bh=XwIy3zsdNA5CPbMjfeaGgN4as3MANqVvK+TxzD77T6g=;
	b=uKmgp7vgYlpyoH80W0T/HxJJqjdMMXykf+DXITE9QPq/M9GDjw5TLeD4zmR19jD5QLKw
	 QGkExRzpgAeT7WTkcivmY70bFEOXDCdSubJwaS1L//yCglY+Iygm4qJkXu9fhoebZ75xW
	 z0wKE+8ezdNNjGgvkggDQKFR4cF6uTWMOjNllYAHRk7e2n2zUOhBpfZ5xYot6FkdQ/CJ5
	 os2XE7/em2E1pG48A6n43KJJTB4gUGT9CIA9aiHnc1QZPsbT/t+zVkueNkuJgwa/Wn0/M
	 1Cx9dqjwZyGWxwU11lzzjCE+K5NjCZZd1aYJ+nY+H1REW3zxpKYHTVNsIz2e8IWxc6g==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=D3GGF77O;
	arc=none smtp.remote-ip=100.103.45.18
X-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 14EE2606A322;
	Thu,  3 Dec 2026 08:29:34 +0000 (UTC)
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id C644B1F00893;
	Thu,  3 Dec 2026 08:29:33 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1796286574;
	bh=XwIy3zsdNA5CPbMjfeaGgN4as3MANqVvK+TxzD77T6g=;
	h=Subject:From:To:Cc:Date:In-Reply-To:References;
	b=D3GGF77OA8+udHd52+uIGYWrhoBw+SZXDm1kaQzn7qv0MdAFCs+9zYmEHo3AMpGxs
	 pRj8jwBkRPOxiNHOlB/+Epq54jFUjePAOyAn/NvDlD3OyRqTQouCskfVFZOl3sK+ps
	 gpVy86JPOwLrnH59Ao+O3gGW4ejidmHa/abR82c6pdF0Tr7Q5LpeTMiPqT+6uKnDSI
	 k9kX1YpGBl7OfgPiZokLDeXCbmfmHZzoDbLdL5zIsW+l7VhEzGHSJ1VdVW8FyA7ore
	 7LfEdrSeaOhWtLK9D8hrUnKMgvS02eBUxkxLJyg37k+UWWqnx15z1lcG0yJhp12Qc4
	 cazVgimm719yw==
X-Cc: maxime.chevallier@bootlin.com, andrew+netdev@lunn.ch, davem@davemloft.net,
 edumazet@kernel.org, kuba@kernel.org, pabeni@redhat.com, robh@kernel.org,
 krzk+dt@kernel.org, conor+dt@kernel.org, mcoquelin.stm32@gmail.com,
 alexandre.torgue@foss.st.com, richardcochran@gmail.com,
 netdev@vger.kernel.org, devicetree@vger.kernel.org,
 linux-stm32@st-md-mailman.stormreply.com,
 linux-arm-kernel@lists.infradead.org
X-In-Reply-To: <c0bc9280fa492b03753d6eea686fe387e4373df5.1796106489.git.jjc@jclark.com>
X-sashiko-severity: Medium
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