From: "Russell King (Oracle)" <linux@armlinux.org.uk>
To: Kory Maincent <kory.maincent@bootlin.com>
Cc: "Simon Horman" <horms@kernel.org>, "Andrew Lunn" <andrew@lunn.ch>,
"Heiner Kallweit" <hkallweit1@gmail.com>,
"David S. Miller" <davem@davemloft.net>,
"Eric Dumazet" <edumazet@google.com>,
"Jakub Kicinski" <kuba@kernel.org>,
"Paolo Abeni" <pabeni@redhat.com>,
"Marek Behún" <kabel@kernel.org>,
"Richard Cochran" <richardcochran@gmail.com>,
"Thomas Petazzoni" <thomas.petazzoni@bootlin.com>,
"Maxime Chevallier" <maxime.chevallier@bootlin.com>,
linux-kernel@vger.kernel.org, netdev@vger.kernel.org
Subject: Re: [PATCH net-next v2 2/2] net: phy: Add Marvell PHY PTP support
Date: Fri, 11 Apr 2025 09:25:23 +0100 [thread overview]
Message-ID: <Z_jR82l7ZRwvunuH@shell.armlinux.org.uk> (raw)
In-Reply-To: <20250411100127.2d87812f@kmaincent-XPS-13-7390>
On Fri, Apr 11, 2025 at 10:01:27AM +0200, Kory Maincent wrote:
> On Thu, 10 Apr 2025 20:40:12 +0100
> "Russell King (Oracle)" <linux@armlinux.org.uk> wrote:
>
> > On Thu, Apr 10, 2025 at 07:16:47PM +0100, Russell King (Oracle) wrote:
> > > On Thu, Apr 10, 2025 at 06:02:05PM +0200, Kory Maincent wrote:
> > > > On Thu, 10 Apr 2025 16:41:06 +0100
> > > > "Russell King (Oracle)" <linux@armlinux.org.uk> wrote:
>
> > > > It seems you are still using your Marvell PHY drivers without my change.
> > > > PTP L2 was broken on your first patch and I fixed it.
> > > > I have the same result without the -2 which mean ptp4l uses UDP IPV4.
> > >
> > > I'm not sure what you're referring to.
> >
> > Okay, turns out to be nothing to do with any fixes in my code or not
> > (even though I still don't know what the claimed brokenness you
> > refer to actually was.)
>
> If I remember well you need the PTP global config 1 register set to 3 to have
> the L2 PTP working.
The PTP global config 1 register determines which message IDs get
timestamped, both for incoming and outgoing messages.
Setting it to 0x3 means that only Sync and Delay_Req messages only
get stamped, irrespective of whether userspace wants to stamp
messages in the transmit path with other message IDs.
With it set to ~0 as I have it, this means all PTP messages are
candidates for being stamped.
As this is a global register, which can be shared between ports (not
for 1510, but may be for other PHYs or DSA), and we have no idea which
messages will need to be stamped, setting it to ~0 is sensible, and
it's also what would be expected of the PTP layers, because we report
back to userspace HWTSTAMP_FILTER_SOME which means "return value: time
stamp all packets requested plus some others" (from the documentation).
I'm currently using 0x0203 (sync, delay_req, delay_resp) and it's
working mostly fine, although I do from time to time see rx overruns
and sometimes tx timestamps missed. I'm trying to fix that before I
post updated patches.
It should be fine with other values too, and should have no effect
whether L2 and L4 are used. DSA sets this to 0x0f, which uses the
same hardware, and I assume is well tested:
/* MV88E6XXX_PTP_MSG_TYPE is a mask of PTP message types to
* timestamp. This affects all ports that have timestamping enabled,
* but the timestamp config is per-port; thus we configure all events
* here and only support the HWTSTAMP_FILTER_*_EVENT filter types.
*/
err = mv88e6xxx_ptp_write(chip, MV88E6XXX_PTP_MSGTYPE,
MV88E6XXX_PTP_MSGTYPE_ALL_EVENT);
#define MV88E6XXX_PTP_MSGTYPE_ALL_EVENT 0x000f
with peer delay response messages directed to the second arrival
timestamp registers:
/* Use ARRIVAL1 for peer delay response messages. */
err = mv88e6xxx_ptp_write(chip, MV88E6XXX_PTP_TS_ARRIVAL_PTR,
MV88E6XXX_PTP_MSGTYPE_PDLAY_RES);
#define MV88E6XXX_PTP_MSGTYPE_PDLAY_RES 0x0008
Please re-test with other values and report how it doesn't work.
--
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!
next prev parent reply other threads:[~2025-04-11 8:25 UTC|newest]
Thread overview: 48+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-07 14:02 [PATCH net-next v2 0/2] Add Marvell PHY PTP support Kory Maincent
2025-04-07 14:03 ` [PATCH net-next v2 1/2] net: phy: Move Marvell PHY drivers to its own subdirectory Kory Maincent
2025-04-07 14:03 ` [PATCH net-next v2 2/2] net: phy: Add Marvell PHY PTP support Kory Maincent
2025-04-07 14:15 ` Kory Maincent
2025-04-08 15:49 ` Simon Horman
2025-04-08 17:32 ` Russell King (Oracle)
2025-04-09 8:18 ` Kory Maincent
2025-04-09 8:33 ` Russell King (Oracle)
2025-04-09 8:48 ` Kory Maincent
2025-04-09 12:16 ` Russell King (Oracle)
2025-04-09 12:38 ` Kory Maincent
2025-04-09 13:35 ` Russell King (Oracle)
2025-04-09 16:04 ` Kory Maincent
2025-04-09 17:34 ` Russell King (Oracle)
2025-04-09 22:38 ` Russell King (Oracle)
2025-04-10 4:16 ` Richard Cochran
2025-04-10 7:44 ` Russell King (Oracle)
2025-04-21 11:20 ` Richard Cochran
2025-04-10 9:17 ` Kory Maincent
2025-04-10 15:41 ` Russell King (Oracle)
2025-04-10 16:02 ` Kory Maincent
2025-04-10 18:16 ` Russell King (Oracle)
2025-04-10 19:40 ` Russell King (Oracle)
2025-04-11 8:01 ` Kory Maincent
2025-04-11 8:25 ` Russell King (Oracle) [this message]
2025-04-09 8:07 ` Kory Maincent
2025-04-11 15:53 ` Simon Horman
2025-04-09 15:34 ` Russell King (Oracle)
2025-04-09 16:01 ` Kory Maincent
2025-04-07 14:08 ` [PATCH net-next v2 0/2] " Andrew Lunn
2025-04-07 14:31 ` Kory Maincent
2025-04-07 16:02 ` Russell King (Oracle)
2025-04-07 16:20 ` Kory Maincent
2025-04-07 16:32 ` Russell King (Oracle)
2025-04-07 16:39 ` Kory Maincent
2025-04-08 20:38 ` Russell King (Oracle)
2025-04-09 8:31 ` Kory Maincent
2025-04-09 8:35 ` Russell King (Oracle)
2025-04-09 8:38 ` Vladimir Oltean
2025-04-09 8:48 ` Kory Maincent
2025-04-09 9:28 ` Russell King (Oracle)
2025-04-09 8:46 ` Kory Maincent
2025-04-09 9:29 ` Russell King (Oracle)
2025-04-09 12:23 ` Kory Maincent
2025-04-09 12:46 ` Maxime Chevallier
2025-04-09 14:49 ` Kory Maincent
2025-04-09 15:10 ` Maxime Chevallier
2025-04-09 15:14 ` Kory Maincent
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=Z_jR82l7ZRwvunuH@shell.armlinux.org.uk \
--to=linux@armlinux.org.uk \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=hkallweit1@gmail.com \
--cc=horms@kernel.org \
--cc=kabel@kernel.org \
--cc=kory.maincent@bootlin.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=maxime.chevallier@bootlin.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=richardcochran@gmail.com \
--cc=thomas.petazzoni@bootlin.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;
as well as URLs for NNTP newsgroup(s).