]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
net: stmmac: Fix E2E delay mechanism
authorNazim Amirul <muhammad.nazim.amirul.nazle.asmade@altera.com>
Tue, 28 Jul 2026 06:09:04 +0000 (23:09 -0700)
committerJakub Kicinski <kuba@kernel.org>
Thu, 30 Jul 2026 00:39:34 +0000 (17:39 -0700)
For E2E delay mechanism, "received DELAY_REQ without timestamp" error
messages show up for dwmac v3.70+ and dwxgmac IPs.

This issue affects socfpga platforms, Agilex7 (dwmac 3.70) and
Agilex5 (dwxgmac). According to the databook, to enable timestamping
for all events, the SNAPTYPSEL bits in the MAC_Timestamp_Control
register must be set to 2'b01, and the TSEVNTENA bit must be cleared
to 0'b0.

Commit 3cb958027cb8 ("net: stmmac: Fix E2E delay mechanism") already
addresses this problem for all dwmacs above version v4.10. However,
same holds true for v3.70 and above, as well as for dwxgmac. Updates
the check accordingly.

Fixes: 14f347334bf2 ("net: stmmac: Correctly take timestamp for PTPv2")
Fixes: f2fb6b6275eb ("net: stmmac: enable timestamp snapshot for required PTP packets in dwmac v5.10a")
Fixes: 3cb958027cb8 ("net: stmmac: Fix E2E delay mechanism")
Reviewed-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
Signed-off-by: Rohan G Thomas <rohan.g.thomas@altera.com>
Signed-off-by: Nazim Amirul <muhammad.nazim.amirul.nazle.asmade@altera.com>
Link: https://patch.msgid.link/20260728060904.31993-1-muhammad.nazim.amirul.nazle.asmade@altera.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c

index 151c77713025cadf8039780a0170072e6b350540..3801f9d45278efeee5753c8d50180bdb40306bd3 100644 (file)
@@ -755,7 +755,8 @@ static int stmmac_hwtstamp_set(struct net_device *dev,
                        config->rx_filter = HWTSTAMP_FILTER_PTP_V2_EVENT;
                        ptp_v2 = PTP_TCR_TSVER2ENA;
                        snap_type_sel = PTP_TCR_SNAPTYPSEL_1;
-                       if (priv->synopsys_id < DWMAC_CORE_4_10)
+                       if (priv->synopsys_id < DWMAC_CORE_3_70 &&
+                           priv->plat->core_type != DWMAC_CORE_XGMAC)
                                ts_event_en = PTP_TCR_TSEVNTENA;
                        ptp_over_ipv4_udp = PTP_TCR_TSIPV4ENA;
                        ptp_over_ipv6_udp = PTP_TCR_TSIPV6ENA;