[Linuxptp-devel] [PATCH 0/3] Bug fix and improved clockcheck

2022-10-05 Thread Miroslav Lichvar
This set improves the clock check to consider the last frequency set by ptp4l/phc2sys in order to detect cases where multiple processes are trying to control the same clock due to a misconfiguration or bug. The first two patches fix a recent bug in phc2sys and remove an old workaround to enable th

[Linuxptp-devel] [PATCH 2/3] Drop support for old kernels returning zero frequency.

2022-10-05 Thread Miroslav Lichvar
Some ancient kernels had a bug in reading of the clock frequency, which was worked around by commit da347d7a36f2 ("ptp4l: Set clock frequency on start"). Drop this workaround and support for the old kernels to make clockadj_get_freq() useful. Signed-off-by: Miroslav Lichvar --- clock.c | 7 --

[Linuxptp-devel] [PATCH 1/3] phc2sys: Add clocks after processing configuration.

2022-10-05 Thread Miroslav Lichvar
Clocks specified by the -c option, or the default CLOCK_REALTIME, were added before the default values (e.g. sanity_freq_limit) were set in the private structure used by clock_add(). Rework the code to save the names of sink clocks from command line and add them only after the configuration is com

[Linuxptp-devel] [PATCH 3/3] Extend clockcheck to check for changes in frequency.

2022-10-05 Thread Miroslav Lichvar
Before setting the new frequency offset on a clock update, compare the current frequency with the value saved from the previous update and print a warning message if they are different. This should detect misconfigurations where multiple processes are trying to control the clock (e.g. another ptp4