Article View: linux.kernel.netdev
Article #25724Re: [PATCH net 1/2] net: phy: broadcom: fix two-step P2P timestamping
From: Nicolai Buchwitz
Date: Wed, 02 Dec 2026 09:53
Date: Wed, 02 Dec 2026 09:53
44 lines
10513 bytes
10513 bytes
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: 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);
Tested-by: Nicolai Buchwitz <nb@tipi-net.de> # CM4, CM5
Reviewed-by: Nicolai Buchwitz <nb@tipi-net.de>
Thanks,
Nicolai
Technical Details
Message-ID:
<57463bb40dac300d7162ccebe32bc222@tipi-net.de>Path:
mbox-mo1.pugleaf.net!srv.newsdeef.eu.MISMATCH!feed-us-txt.newsdeef.eu!feed-us-ny.newsdeef.eu!srv.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-375707-linux-kernel-netdev=dewy.ruReferences:
<cover.1795772837.git.jjc@jclark.com> <5cefa3ba7e356bd2d3fa05cef28e875f4fa6266b.1795772837.git.jjc@jclark.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu.MISMATCH!feed-us-txt.newsdeef.eu!feed-us-ny.newsdeef.eu!srv.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-375707-linux-kernel-netdev=dewy.ru From: nb@tipi-net.de (Nicolai Buchwitz) Newsgroups: linux.kernel.netdev Subject: Re: [PATCH net 1/2] net: phy: broadcom: fix two-step P2P timestamping Date: Wed, 02 Dec 2026 10:53:59 +0100 Organization: Usenet Network Message-ID: <57463bb40dac300d7162ccebe32bc222@tipi-net.de> References: <cover.1795772837.git.jjc@jclark.com> <5cefa3ba7e356bd2d3fa05cef28e875f4fa6266b.1795772837.git.jjc@jclark.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: usenet.network; logging-data="1940922"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:cC5VGL7EKHTvaWVGECaBSLVfnls= sha256:SM0VSwfFIgoWpdLbhIqP90mCYm41XTt/1nv4nVZxXho= sha1:r0CXZyHtz3cgXNeWsB1bNRejo8o= sha256:21bnk+vkSLxysPX/x4c3Seth+bdZ/4l0wS6ZnqMYkB8= List-ID: <netdev.vger.kernel.org> X-Mailpost-Empty-Hdrs: X-Spam-Level X-Received: from localhost (localhost [127.0.0.1]) by mail.dewy.ru (Postfix) with ESMTP id B1A031175F1; Wed, 2 Dec 2026 12:54:28 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.051 X-Spam-Status: No, score=-3.051 tagged_above=-9999 required=6.31 tests=[DCC_REPUT_70_89=0.1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.249, MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key) header.d=tipi-net.de X-Received: from mail.dewy.ru ([127.0.0.1]) by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id yp-0Ol1AMJmw; Wed, 2 Dec 2026 12:54:25 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-375707-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> X-Authentication-Results: OpenDMARC; dmarc=none (p=none dis=none) header.from=tipi-net.de X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10]) by mail.dewy.ru (Postfix) with ESMTPS id 68E031175EE; Wed, 2 Dec 2026 12:54:16 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by sea.lore.kernel.org (Postfix) with ESMTP id 31B862D71B; Wed, 2 Dec 2026 09:54:14 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1796205253; b=wvGzIzmJfoRZCgc4hh44xOX52duE+P3l44j6rDzykfTSZWxX5rY97YwjQmtg/0Fsc8Lr n2TXG/h/EJPH7Q+0x4NpDHT/E9bsPUcz9ucm6VA0pR4GDL77c3qWa25wLKSefl7qUPFUI FL3lAI+/hTFI8ZX5CXnUHsPlq/zCaoc+fHRfE+PRUJCQg57pDsFEk1EnCdHIMD9qJEyEy 3X6Kgm3cfCZ+8AHokCIp024TBL1b+en21pJFYk79HlkzwPXSf3P6PsjpSdvMEwhvleB2g LzjWKVCAd8lLD5PHmazWD9bWNexh8123sbJNl0e83evPWa1sk0y3owXvSwwUZRt9Cdw== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796205253; h=X-Original-To:Received:DMARC-Filter:Received:DKIM-Signature: X-Mailing-List:List-Id:List-Post:List-Help:List-Subscribe: List-Unsubscribe:List-Owner:Precedence:MIME-Version:Date:From:To:Cc: Subject:In-Reply-To:References:Message-ID:X-Sender:Content-Type: Content-Transfer-Encoding:X-Last-TLS-Session-Version; bh=kJ7LYUeTThuU7cfl0wcfnKhFZOvzAKhoofBj/urunrM=; b=hf8f26XJlzhYjhNg6qQ503IgDZYISFiD/q1NJFzxzju/lpH6oCAS1u3UxY0C4FXWYEhM ZbgTDfOiop1D1nspRw1i+RbZAL9fiX71KnvfSSN5N8XnWZGnxiChBTA+kfRzFauBXclNa vM6HFhVI1jwNv0sLN3V37btXVdJEaTnukSsriZEQMLyQ+a0GrHP6qrbDX5vTAM1bdvbcv oIdhOWxiyfT4mUKD8zF4cWgXvfGrfJhjl4Tvcyle0abTnOPJ+GQfeheRy7DeD5j17j86N y3sA1j+b0+girArMFroZt0E7xWMdvv/j3TheZIn+dRH+AtY9J7rqOMW1aKI1F1ZZFVA== X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=tipi-net.de header.i=@tipi-net.de header.a=rsa-sha256 header.s=dkim header.b=IQ3Dthv1; dmarc=none header.from=tipi-net.de; spf=pass smtp.mailfrom=tipi-net.de; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7E580606A330; Wed, 2 Dec 2026 09:54:13 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=tipi-net.de header.i=@tipi-net.de header.a=rsa-sha256 header.s=dkim header.b=IQ3Dthv1 X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=194.13.80.246 X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796205252; b=RC4FasuCF1lkih2u/yLbp/J2HyINBbRt2eNCiCyXPt+g4FGwwAT24RUTAvixhf3h1oOZ wjnN0/ME/Wk679A0+inMO0Xo5VigFJDbxUYPveQj8QqjYK4z/y97oPLKwVlHqpugup8Ha wIPZMX3TZx1BVSboX6hV46keEJGJJsCzFlsWRrvqUg91JhspY4vSfwQh3C5avL7MQSI/m y31CSaXP5kbYrZIBiYUQ5EguPbJW4jNok/durULJQzLRXK7u1jVo0z2qq+RnWMJq6l+Bi AmD/XC3xI8uuPfL5dv25S9Zgr6wXC417IhK6XP5WuhfDC+vskM12ZliQC7hg187ogkQ== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796205252; h=DMARC-Filter:Received:DKIM-Signature:MIME-Version:Date:From:To:Cc: Subject:In-Reply-To:References:Message-ID:X-Sender:Content-Type: Content-Transfer-Encoding:X-Last-TLS-Session-Version; bh=kJ7LYUeTThuU7cfl0wcfnKhFZOvzAKhoofBj/urunrM=; b=UMX4n0p/B5ptTIDyEK5+9L7RAmeNEOXSLTOGMMf1xpyvKEO15Tuo7PYYydNq5SdONCeg tWRofVfZY3kDD6JpTglqEBaTZlfcT88oS+4Et0KiWmYAhPTwdmdqH6d42JUCvM970TkzH HY2PRowvNqHQu4aWYG+8gLQ/ajfyaCFVKZhhg6tPZd9wxlu7ArczoRcxxm6aAaXG5rBK/ rcFgEOnhrHNeSX9uoUwkhqo+AjDAYlWmbK4Nr2zzSfWwXfI50V4WbeEAOxJQU7zngvwIp QBeeLw3H1wNEaRDs7SxA0jwZyH97mINmO9C9RKTia8hJ4HRFsb4DgodWeSKIahWQkdQ== X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none header.from=tipi-net.de; spf=pass smtp.mailfrom=tipi-net.de; dkim=pass header.d=tipi-net.de header.i=@tipi-net.de header.a=rsa-sha256 header.s=dkim header.b=IQ3Dthv1; arc=none smtp.remote-ip=194.13.80.246 X-Received: from mail.tipi-net.de (mail.tipi-net.de [194.13.80.246]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 66A78606A323 for <netdev@vger.kernel.org>; Wed, 2 Dec 2026 09:54:10 +0000 (UTC) X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 66A78606A323 X-Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=tipi-net.de X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=tipi-net.de X-Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 08B54A0044; Wed, 02 Dec 2026 10:53:59 +0100 (CET) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tipi-net.de; s=dkim; t=1796205242; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=kJ7LYUeTThuU7cfl0wcfnKhFZOvzAKhoofBj/urunrM=; b=IQ3Dthv1TaBIp8xde7drmK2XwKaX7njzhawPo2Xy/BruPPCDCyASLp3vbn+kSr0DJTcVMN sa2MjLlQDlVtA5UvSziBGPSrIwdnsfD9Z8ZXny8nmS8hxKZPW+FLRrbDfsQ1tuIC43qJ/A RVlehExEIyy3NgAKW+ksTit/jAHW/H5pC3MK2iupf2L88RKZRQlPmlzqSdxLsMafck3EOt kEziK8HyfWghyrotQw1Nkz6SuHsqUr4/3C5lobSxbakUXZmH0UIvfWt1IOkvHJ4r0LeNza 9aIkUYT0pPVRezIMgRG6bo3l1Z0wt482rIOGPjfs+fuMhUFg/aAIOJ3i5F3zBA== X-Mailing-List: netdev@vger.kernel.org X-List-Post: <mailto:netdev@vger.kernel.org> X-List-Help: <mailto:netdev+help@vger.kernel.org> X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org> X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org> X-List-Owner: <mailto:netdev+owner@vger.kernel.org> X-Precedence: list X-Cc: 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>, 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 X-In-Reply-To: <5cefa3ba7e356bd2d3fa05cef28e875f4fa6266b.1795772837.git.jjc@jclark.com> X-Sender: nb@tipi-net.de X-Last-TLS-Session-Version: TLSv1.3