-
Notifications
You must be signed in to change notification settings - Fork 5.2k
PTP hardware timestamping appears broken on Pi 5 #5904
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
The Pi 5 PHY does not support hardware timestamping. |
What? I've seen (perhaps 3rd party) reviews about it supporting PTP hardware timestamping. Cadence GEM MACs support PTP (unsure about the PHY support). Perhaps this should be reopened to properly detect hardware timestamping support in the GEM/macb driver. However PHC itself should be kept as we tested it to be functional and properly adjustable even with userspace timestamping. |
Works on my machine(s)? CM4+CM4IO plugged into a dumb switch with a Pi 5. CM4 assumes master role, Pi 5 syncs to master.
|
The MAC driver registers the ptp device in this case, not the PHY driver. What is your server configuration? I see you have
in the log. |
Both ptp4l and statime (with all 4 combinations of these two on the either side) produce the same: missing RX timestamps. The server is a PC with USB NIC using software (kernel) timestamping. @P33M what are your kernel and ptp4l versions? |
Pi 5:
Local kernel build, but reflects latest rpi-update. CM4:
Interestingly, if I swap CM4 to slave mode and the Pi 5 assumes master role then the CM4 reports sync errors similar to yours.
The MAC supports both one-step and two-step timestamping. It appears that the Pi 4 is expecting two-step but the Pi 5 is transmitting one-step frames. |
I'll try a bit more and could maybe also do a 3.1.1 linuxptp build (it's missing some of the features I use) |
ptp4l from Git v3.1.1 exhibits the same behavior. Current kernel: If PC with software timestamps is client and Pi is server it shows |
I have played around a bit with the hardware timestamping available on the PI 5 and there are definitely a few strange things going on which suggest to me there are some driver and/or kernel bugs involved. When looking at IPv4 ptp packets, when configuring the driver to timestamp only layer 4 v2 ptp packets (passing HWTSTAMP_FILTER_PTP_V2_L4_EVENT to the SIOCSHWTSTAMP ioctl), some received packets are not properly timestamped. However, when enabling the HWTSTAMP_FILTER_ALL filter (which is according to ethool -T the only filter that is supported, and hence what HWTSTAMP_FILTER_PTP_V2_L4_EVENT should be upgraded to) send timestamps for delay requests are suddenly not properly timestamped. However, looking at ethernet packets, due to a bug I was configuring this also with HWTSTAMP_FILTER_PTP_V2_L4_EVENT, and there all ptp packets seem to get timestamped. So the upgrade process at least partially works. Not sure what is going on in the driver exactly but definitely some hardware timestamping bugs. All this testing was done on the 6.1.0-rpi8-rpi-2712 kernel |
Further update: for ethernet packets, the send timestamping not working when using HWTSTAMP_FILTER_ALL also occurs for ptp over raw ethernet. |
Thanks for looking into this! |
I'm configuring a Raspberry Pi 5 with a ZED-F9T (via SparkFun GNSS over RS-232), hoping to use it for PTP hardware timestamping. Following this thread. I also have a TimeBeat w/the CM4 sandwich to reference. |
I am running on RPI5, 6.6.20+rpt-rpi-2712 When enabling PTP with same config that I have on other x64 hosts, I started to receive these; ptp4l[1546.963]: port 1: received SYNC without timestamp I added the hwts_filter to "full" in the ptp4l config, which seems to have effect. The default for hwts_filter is "normal". Not only are the SYNC without timestamps events gone, but chrony seems to accept the PTP now
|
Have you tried |
I have a issue on the CM4 that seems related to a driver bug. I can setup a PTP master that syncs fine with pdelay mechanism using UDP (low nanosecond values) . but when switching to L2 then the pdelay timestamps are very inaccurate (60 to 80 microseconds or more with large jitter) this seems like it defaults to software timestamping for those packets. |
It seems the CM4 can't timestamp TX packets that have the minor version set to a non-zero value. See here. I was struggling with a similar issue on the Realtek 8125. Compiling linuxptp 4.4 (instead of version 4.0 deliverd with Ubuntu Noble) and setting |
I can confirm this as well with the Pi 5 - it refused to sync to another host, giving the mentioned "without timestamp" messages. Setting Some versions and details: Host:
Pi 5:
@ewaldc that link seems to be broken |
Link corrected, my mistake (working too late). Sorry for the inconvenience. |
Uh oh!
There was an error while loading. Please reload this page.
Describe the bug
Apparently hardware timestamping is somehow broken and applications don't get timestamps delivered.
Steps to reproduce the behaviour
Run ptp4l in hardware timestamping mode. It will have timestamp errors. Also reproducible with statime when PHC is enabled.
Device (s)
Raspberry Pi 5
System
Raspberry Pi reference 2023-12-11
Generated using pi-gen, https://github.com/RPi-Distro/pi-gen, 2acf7afcba7d11500313a7b93bb55a2aae20b2d6, stage2
2024/01/24 12:16:01
Copyright (c) 2012 Broadcom
version 1aeae380 (release) (embedded)
Linux helios 6.6.13-v8-16k+ #1724 SMP PREEMPT Mon Jan 22 13:14:14 GMT 2024 aarch64 GNU/Linux
Same happens on 6.1 kernel series
Logs
Hardware timestamping (
sudo ptp4l -i eth0 -l 7 -m -q -s
):Software timestamping (
sudo ptp4l -i eth0 -l 7 -m -q -s -S
):Additional context
I am currently going to do additional tests like https://github.com/torvalds/linux/blob/master/tools/testing/selftests/net/timestamping.c to surely isolate the issue.
The text was updated successfully, but these errors were encountered: