OSDN Git Service

ptp: Add cycles support for virtual clocks
authorGerhard Engleder <gerhard@engleder-embedded.com>
Fri, 6 May 2022 20:01:37 +0000 (22:01 +0200)
committerPaolo Abeni <pabeni@redhat.com>
Tue, 10 May 2022 07:48:08 +0000 (09:48 +0200)
commit42704b26b0f1d891f6cf4ebc877dbac0d17c690d
tree283ba260e6ab1b1add2628846ae4cabd657e12ed
parentb3552d6a3b8bd4260a971f1f70140ed3513cc4f7
ptp: Add cycles support for virtual clocks

ptp vclocks require a free running time for their timecounter.
Currently only a physical clock forced to free running is supported.
If vclocks are used, then the physical clock cannot be synchronized
anymore. The synchronized time is not available in hardware in this
case. As a result, timed transmission with TAPRIO hardware support
is not possible anymore.

If hardware would support a free running time additionally to the
physical clock, then the physical clock does not need to be forced to
free running. Thus, the physical clocks can still be synchronized
while vclocks are in use.

The physical clock could be used to synchronize the time domain of the
TSN network and trigger TAPRIO. In parallel vclocks can be used to
synchronize other time domains.

Introduce support for a free running cycle counter called cycles to
physical clocks. Rework ptp vclocks to use this free running cycle
counter. Default implementation is based on time of physical clock.
Thus, behavior of ptp vclocks based on physical clocks without free
running cycle counter is identical to previous behavior.

Signed-off-by: Gerhard Engleder <gerhard@engleder-embedded.com>
Acked-by: Richard Cochran <richardcochran@gmail.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
drivers/ptp/ptp_clock.c
drivers/ptp/ptp_private.h
drivers/ptp/ptp_sysfs.c
drivers/ptp/ptp_vclock.c
include/linux/ptp_clock_kernel.h