Skip to content

Conversation

@karlkinsella
Copy link

Using the ioctl PTP_SYS_OFFSET_EXTENDED via testptp:

#testptp -d /dev/ptp2 -x 1
extended timestamp request returned 1 samples
sample # 0: real time before: 1765392269.485510129
            phc time: 1765392306.482641995
            real time after: 1765392265.190545816       <- This value is incorrect

The issue was that the ts_window_adjust is a negative value.

#cat /sys/class/timecard/ocp0/ts_window_adjust
-3

Due to delay in ptp_ocp_estimate_pci_timing() getting initialized to a U64_MAX should be S64_MAX (as ktime_t is "typedef s64 ktime_t;")
With this change:

# cat /sys/class/timecard/ocp0/ts_window_adjust
267
# /root/testptp/testptp -d /dev/ptp2 -x 1
extended timestamp request returned 1 samples
sample # 0: real time before: 1765392342.651265647
            phc time: 1765392379.647310186
            real time after: 1765392342.651268356

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant