[Linuxptp-devel] [PATCH v2 0/2] fix fallback clock_gettime for test_phc

2021-10-22 Thread Jacob Keller
The current implementation of test_phc cmp has a fallback flow for comparing the PHC clock to the CLOCK_REAMTIME. This fallback flow calculates the inverse offset compared to the offsets calculated by the PTP_SYS_OFFSET ioctls. Fix this by replacing its implementation with the one from phc2sys. Mo

[Linuxptp-devel] [PATCH v2 1/2] phc2sys: move read_phc into clock_adj.c

2021-10-22 Thread Jacob Keller
The read_phc function implemented in phc2sys.c is used to perform clock comparison between two arbitrary clocks using clock_gettime. This support is used to allow phc2sys to work on any pair of clocks and is implemented in a very similar manner as the kernel PTP_SYS_OFFSET ioctls. Make this funct

[Linuxptp-devel] [PATCH v2 2/2] phc_ctl: replace calculate_offset with clockadj_compare

2021-10-22 Thread Jacob Keller
The phc_ctl program includes an implementation for comparing the PHC with CLOCK_REALTIME when PTP_SYS_OFFSET ioctls are not supported. This implementation produces inverted results when compared with the implementation of the ioctl. The PTP_SYS_OFFSET ioctls calculate the difference as "CLOCK_REA

Re: [Linuxptp-devel] [PATCH 2/2] phc_ctl: replace calculate_offset with clockadj_compare

2021-10-22 Thread Keller, Jacob E
On 10/22/2021 1:58 PM, Keller, Jacob E wrote: > The phc_ctl program includes an implementation for comparing the PHC > with CLOCK_REALTIME when PTP_SYS_OFFSET ioctls are not supported. > > This implementation produces inverted results when compared with the > implementation of the ioctl. > > The

[Linuxptp-devel] [PATCH 1/2] phc2sys: move read_phc into clock_adj.c

2021-10-22 Thread Jacob Keller
The read_phc function implemented in phc2sys.c is used to perform clock comparison between two arbitrary clocks using clock_gettime. This support is used to allow phc2sys to work on any pair of clocks and is implemented in a very similar manner as the kernel PTP_SYS_OFFSET ioctls. Make this funct

[Linuxptp-devel] [PATCH 2/2] phc_ctl: replace calculate_offset with clockadj_compare

2021-10-22 Thread Jacob Keller
The phc_ctl program includes an implementation for comparing the PHC with CLOCK_REALTIME when PTP_SYS_OFFSET ioctls are not supported. This implementation produces inverted results when compared with the implementation of the ioctl. The PTP_SYS_OFFSET ioctls calculate the difference as "CLOCK_REA

[Linuxptp-devel] [PATCH 0/2] fix fallback clock_gettime for test_phc

2021-10-22 Thread Jacob Keller
The current implementation of test_phc cmp has a fallback flow for comparing the PHC clock to the CLOCK_REAMTIME. This fallback flow calculates the inverse offset compared to the offsets calculated by the PTP_SYS_OFFSET ioctls. Fix this by replacing its implementation with the one from phc2sys. Mo