Merge branch 'ptp-ptp_clockmatrix-Fix-output-1-PPS-alignment'
authorDavid S. Miller <davem@davemloft.net>
Wed, 17 Feb 2021 21:49:26 +0000 (13:49 -0800)
committerDavid S. Miller <davem@davemloft.net>
Wed, 17 Feb 2021 21:49:26 +0000 (13:49 -0800)
commit41f1a01bb6c678681147f52180a7c20b0e12e137
tree21d2ee459c8b55ba4533b03f83f429c3424c1c51
parent857490807368026116a16306ab89e9b71cad60ab
parent77fdb168a3e2a633fd8e5a0c9ecadcb86c9372cb
Merge branch 'ptp-ptp_clockmatrix-Fix-output-1-PPS-alignment'

Vincent Cheng says:

====================
ptp: ptp_clockmatrix: Fix output 1 PPS alignment.

This series fixes a race condition that may result in the output clock
not aligned to internal 1 PPS clock.

Part of device initialization is to align the rising edge of output
clocks to the internal rising edge of the 1 PPS clock.  If the system
APLL and DPLL are not locked when this alignment occurs, the alignment
fails and a fixed offset between the internal 1 PPS clock and the
output clock occurs.

If a clock is dynamically enabled after power-up, the output clock
also needs to be aligned to the internal 1 PPS clock.

v3:
Suggested by: Jakub Kicinski <kuba@kernel.org>
- Remove unnecessary 'err' variable
- Increase msleep()/loop accuracy by using jiffies in while()
- No empty lines between variables
- No empty lines between call and the if
- parenthesis around a == b are unnecessary
- Inconsistent \n usage in dev_()
- Remove unnecessary empty line
- Leave string format in place so static code checkers can
  validate arguments

v2:
Suggested by: Richard Cochran <richardcochran@gmail.com>
- Added const to "char * fmt"
- Break unrelated header change into separate patch
====================

Signed-off-by: David S. Miller <davem@davemloft.net>