Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Lorenzo Bianconi <lorenzo.bianconi@oss.qualcomm.com>
To: James Clark <jjc@jclark.com>
Cc: Maxime Chevallier <maxime.chevallier@bootlin.com>,
	Andrew Lunn <andrew+netdev@lunn.ch>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@kernel.org>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Maxime Coquelin <mcoquelin.stm32@gmail.com>,
	Alexandre Torgue <alexandre.torgue@foss.st.com>,
	Jose Abreu <Jose.Abreu@synopsys.com>,
	netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH net] net: stmmac: xgmac: fix disabling flexible PPS output
Date: Sat, 5 Dec 2026 14:36:18 +0100	[thread overview]
Message-ID: <axQTUh2ZByp171jf@lore-desk> (raw)
In-Reply-To: <20261205092716.17734-1-jjc@jclark.com>

[-- Attachment #1: Type: text/plain, Size: 2042 bytes --]

On Dec 05, James Clark wrote:
> On a Terasic DE25-Nano (Agilex 5, XGMAC core 3.10), disabling PPS
> output 0 with PTP_PEROUT_REQUEST leaves about 15 pulses a second on the
> pin instead of stopping it.
> 
> In the XGMAC register MAC_PPS_CONTROL, bit PPSEN0 selects what bits 3:0
> mean. When PPSEN0 is set, they are PPSCMD0, a command to the flexible
> PPS logic. When it is clear, they are PPSCTRL0, the frequency of output
> 0 in fixed PPS mode. The disable path in dwxgmac2_flex_pps_config()
> clears PPSEN0 and then writes the stop command (0x5). The MAC reads
> this as PPSCTRL0 = 5, so output 0 switches to fixed mode at that
> frequency setting.
> 
> Set PPSENx when disabling, as the enable path does. Commit 520cf6002147
> ("net: stmmac: fix disabling flexible PPS output") made the same fix
> for dwmac5 after the XGMAC code was copied from it.
> 
> Fix tested on the DE25-Nano.
> 
> Fixes: 95eaf3cd0a90 ("net: stmmac: dwxgmac: Add Flexible PPS support")
> Signed-off-by: James Clark <jjc@jclark.com>

Reviewed-by: Lorenzo Bianconi <lorenzo.bianconi@oss.qualcomm.com>

> ---
> I used an LLM coding assistant to help prepare this patch.
> 
> This can be tested on the DE25-Nano using the FPGA design at
> https://github.com/jclark/de25-nano-debian, which connects periodic
> output channel 0 to pin 6 of JP1.
> 
>  drivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c b/drivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c
> index 6b2bfc241109..c43e8c597a09 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c
> @@ -1171,6 +1171,7 @@ static int dwxgmac2_flex_pps_config(void __iomem *ioaddr, int index,
>  
>  	if (!enable) {
>  		val |= XGMAC_PPSCMDx(index, XGMAC_PPSCMD_STOP);
> +		val |= XGMAC_PPSENx(index);
>  		writel(val, ioaddr + XGMAC_PPS_CONTROL);
>  		return 0;
>  	}
> -- 
> 2.56.1
> 
> 

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

      parent reply	other threads:[~2026-12-05 13:36 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-05  9:27 [PATCH net] net: stmmac: xgmac: fix disabling flexible PPS output James Clark
2026-12-05 12:55 ` Maxime Chevallier
2026-12-05 13:36 ` Lorenzo Bianconi [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=axQTUh2ZByp171jf@lore-desk \
    --to=lorenzo.bianconi@oss.qualcomm.com \
    --cc=Jose.Abreu@synopsys.com \
    --cc=alexandre.torgue@foss.st.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@kernel.org \
    --cc=jjc@jclark.com \
    --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 \
    /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