On 27.11.2026 10:50, James Clark wrote:
> 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: stab…@vger.kernel.org
> Signed-off-by: James Clark <j…@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);
Tested-by: Nicolai Buchwitz <n…@tipi-net.de> # CM4, CM5
Reviewed-by: Nicolai Buchwitz <n…@tipi-net.de>
Thanks,
Nicolai