Skip to content

Commit a05d070

Browse files
Binary-Eaterdavem330
authored andcommitted
ptp: Clarify ptp_clock_info .adjphase expects an internal servo to be used
.adjphase expects a PHC to use an internal servo algorithm to correct the provided phase offset target in the callback. Implementation of the internal servo algorithm are defined by the individual devices. Cc: Jakub Kicinski <[email protected]> Cc: Richard Cochran <[email protected]> Signed-off-by: Rahul Rameshbabu <[email protected]> Acked-by: Richard Cochran <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 4931062 commit a05d070

File tree

2 files changed

+20
-2
lines changed

2 files changed

+20
-2
lines changed

Documentation/driver-api/ptp.rst

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,22 @@ Writing clock drivers
7373
class driver, since the lock may also be needed by the clock
7474
driver's interrupt service routine.
7575

76+
PTP hardware clock requirements for '.adjphase'
77+
-----------------------------------------------
78+
79+
The 'struct ptp_clock_info' interface has a '.adjphase' function.
80+
This function has a set of requirements from the PHC in order to be
81+
implemented.
82+
83+
* The PHC implements a servo algorithm internally that is used to
84+
correct the offset passed in the '.adjphase' call.
85+
* When other PTP adjustment functions are called, the PHC servo
86+
algorithm is disabled.
87+
88+
**NOTE:** '.adjphase' is not a simple time adjustment functionality
89+
that 'jumps' the PHC clock time based on the provided offset. It
90+
should correct the offset provided using an internal algorithm.
91+
7692
Supported hardware
7793
==================
7894

include/linux/ptp_clock_kernel.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,10 @@ struct ptp_system_timestamp {
7777
* nominal frequency in parts per million, but with a
7878
* 16 bit binary fractional field.
7979
*
80-
* @adjphase: Adjusts the phase offset of the hardware clock.
81-
* parameter delta: Desired change in nanoseconds.
80+
* @adjphase: Indicates that the PHC should use an internal servo
81+
* algorithm to correct the provided phase offset.
82+
* parameter delta: PHC servo phase adjustment target
83+
* in nanoseconds.
8284
*
8385
* @adjtime: Shifts the time of the hardware clock.
8486
* parameter delta: Desired change in nanoseconds.

0 commit comments

Comments
 (0)