Devicetree
 help / color / mirror / Atom feed
From: netdev-bot+sashiko@kernel.org
To: jjc@jclark.com
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
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	[thread overview]
Message-ID: <179628657335.3146.8324183269390775648@kernel.org> (raw)
In-Reply-To: <c0bc9280fa492b03753d6eea686fe387e4373df5.1796106489.git.jjc@jclark.com>

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

      reply	other threads:[~2026-12-03  8:29 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-01  8:29 [PATCH net-next 0/2] net: stmmac: dwmac-socfpga: route the auxiliary snapshot trigger from the FPGA James Clark
2026-12-01  8:29 ` [PATCH net-next 1/2] dt-bindings: net: altr,socfpga-stmmac: add altr,f2h-ptp-aux-trig James Clark
2026-12-01  8:29 ` [PATCH net-next 2/2] net: stmmac: dwmac-socfpga: route the auxiliary snapshot trigger from the FPGA James Clark
2026-12-03  8:29   ` netdev-bot+sashiko [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=179628657335.3146.8324183269390775648@kernel.org \
    --to=netdev-bot+sashiko@kernel.org \
    --cc=alexandre.torgue@foss.st.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=conor+dt@kernel.org \
    --cc=davem@davemloft.net \
    --cc=devicetree@vger.kernel.org \
    --cc=edumazet@kernel.org \
    --cc=jjc@jclark.com \
    --cc=krzk+dt@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.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=richardcochran@gmail.com \
    --cc=robh@kernel.org \
    /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