forked from torvalds/linux
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
igc: Add support for PTP getcrosststamp()
i225 has support for PCIe PTM, which allows us to implement support for the PTP_SYS_OFFSET_PRECISE ioctl(), implemented in the driver via the getcrosststamp() function. Support is added by having a delayed workqueue that checks if the current PTM cycle has finished and if it has finished, it stores the needed information to be retrieved by the next execution of the getcrosststamp() call. This is needed because it might be need to interpolate the values, which need two set of timestamps (the current and the historic). i225 can be configured to send "fake" packets with the PTM information, adding support for handling these types of packets is left for the future. PTM improves the accuracy of time synchronization, for example, using phc2sys. Before: phc2sys[67.920]: CLOCK_REALTIME phc offset 13 s2 freq -11949 delay 2458 phc2sys[68.170]: CLOCK_REALTIME phc offset 21 s2 freq -11937 delay 2473 phc2sys[68.420]: CLOCK_REALTIME phc offset 22 s2 freq -11930 delay 2457 phc2sys[68.670]: CLOCK_REALTIME phc offset 18 s2 freq -11927 delay 2479 phc2sys[68.920]: CLOCK_REALTIME phc offset 12 s2 freq -11928 delay 2435 phc2sys[69.170]: CLOCK_REALTIME phc offset -3 s2 freq -11939 delay 2465 phc2sys[69.421]: CLOCK_REALTIME phc offset -9 s2 freq -11946 delay 2466 phc2sys[69.671]: CLOCK_REALTIME phc offset -7 s2 freq -11947 delay 2478 phc2sys[69.921]: CLOCK_REALTIME phc offset -6 s2 freq -11948 delay 2468 phc2sys[70.171]: CLOCK_REALTIME phc offset -7 s2 freq -11951 delay 2463 phc2sys[70.421]: CLOCK_REALTIME phc offset -12 s2 freq -11958 delay 2444 After: phc2sys[224.311]: CLOCK_REALTIME phc offset 6 s2 freq -11982 delay 0 phc2sys[224.561]: CLOCK_REALTIME phc offset 8 s2 freq -11978 delay 0 phc2sys[224.811]: CLOCK_REALTIME phc offset 6 s2 freq -11978 delay 0 phc2sys[225.061]: CLOCK_REALTIME phc offset -1 s2 freq -11983 delay 0 phc2sys[225.311]: CLOCK_REALTIME phc offset 3 s2 freq -11980 delay 0 phc2sys[225.561]: CLOCK_REALTIME phc offset 4 s2 freq -11978 delay 0 phc2sys[225.811]: CLOCK_REALTIME phc offset -2 s2 freq -11982 delay 0 phc2sys[226.061]: CLOCK_REALTIME phc offset -3 s2 freq -11984 delay 0 phc2sys[226.311]: CLOCK_REALTIME phc offset 0 s2 freq -11982 delay 0 phc2sys[226.562]: CLOCK_REALTIME phc offset -4 s2 freq -11986 delay 0 phc2sys[226.812]: CLOCK_REALTIME phc offset -9 s2 freq -11992 delay 0 phc2sys[227.062]: CLOCK_REALTIME phc offset 1 s2 freq -11985 delay 0 TODO/Questions: 1. Using convert_art_ns_to_tsc() is too X86 specific, there should be a common way to create a 'system_counterval_t' from a timestamp. 2. convert_art_ns_to_tsc() says that it should only be used when X86_FEATURE_TSC_KNOWN_FREQ is true, but during tests it works even when it returns false. Should that check be done? Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
- Loading branch information
1 parent
9cd2148
commit f6b01c6
Showing
5 changed files
with
220 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters