Netdev List
 help / color / mirror / Atom feed
From: James Clark <jjc@jclark.com>
To: Florian Fainelli <florian.fainelli@broadcom.com>,
	Andrew Lunn <andrew@lunn.ch>,
	Heiner Kallweit <hkallweit1@gmail.com>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@kernel.org>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Richard Cochran <richardcochran@gmail.com>
Cc: Russell King <linux@armlinux.org.uk>,
	Broadcom internal kernel review list
	<bcm-kernel-feedback-list@broadcom.com>,
	Jonathan Lemon <jonathan.lemon@gmail.com>,
	netdev@vger.kernel.org
Subject: [PATCH net 1/2] net: phy: broadcom: fix two-step P2P timestamping
Date: Fri, 27 Nov 2026 16:50:11 +0700	[thread overview]
Message-ID: <5cefa3ba7e356bd2d3fa05cef28e875f4fa6266b.1795772837.git.jjc@jclark.com> (raw)
In-Reply-To: <cover.1795772837.git.jjc@jclark.com>

On a Raspberry Pi CM4 and CM5, with two-step P2P, the BCM54210PE PHY
sends an incorrect Pdelay_Resp: its requestReceiptTimestamp is the time
the Pdelay_Resp was sent, not the time the Pdelay_Req was received.
This is because the driver puts every PTP event message in TX mode 3,
in which the PHY writes the TX timestamp into the message. The peer
then measures a path delay that is tens of microseconds too large.

Use mode 0 for Pdelay_Resp, in which the PHY leaves the message
unchanged and still captures the TX timestamp.

With this patch, on the CM4, the path delay measured with P2P is the
same as with E2E.

Fixes: 39db6be781cd ("net: phy: broadcom: Add PTP support for some Broadcom PHYs.")
Cc: stable@vger.kernel.org
Signed-off-by: James Clark <jjc@jclark.com>
---
 drivers/net/phy/bcm-phy-ptp.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/net/phy/bcm-phy-ptp.c b/drivers/net/phy/bcm-phy-ptp.c
index 443917c9d1bc..4b24ba7115d7 100644
--- a/drivers/net/phy/bcm-phy-ptp.c
+++ b/drivers/net/phy/bcm-phy-ptp.c
@@ -826,8 +826,7 @@ static int bcm_ptp_hwtstamp_set(struct mii_timestamper *mii_ts,
 
 	mode = TX_MODE_SEL(PORT, SYNC, REPLACE_TS) |
 	       TX_MODE_SEL(PORT, DELAY_REQ, REPLACE_TS) |
-	       TX_MODE_SEL(PORT, PDELAY_REQ, REPLACE_TS) |
-	       TX_MODE_SEL(PORT, PDELAY_RESP, REPLACE_TS);
+	       TX_MODE_SEL(PORT, PDELAY_REQ, REPLACE_TS);
 
 	bcm_phy_write_exp(priv->phydev, TX_EVENT_MODE, mode);
 
-- 
2.56.1


  reply	other threads:[~2026-11-27  9:50 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-27  9:50 [PATCH net 0/2] net: phy: broadcom: fix P2P timestamping James Clark
2026-11-27  9:50 ` James Clark [this message]
2026-11-27  9:50 ` [PATCH net 2/2] net: phy: broadcom: fix one-step " James Clark

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=5cefa3ba7e356bd2d3fa05cef28e875f4fa6266b.1795772837.git.jjc@jclark.com \
    --to=jjc@jclark.com \
    --cc=andrew@lunn.ch \
    --cc=bcm-kernel-feedback-list@broadcom.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@kernel.org \
    --cc=florian.fainelli@broadcom.com \
    --cc=hkallweit1@gmail.com \
    --cc=jonathan.lemon@gmail.com \
    --cc=kuba@kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=richardcochran@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