Skip to content

dpll: zl3073x: add PTP clock support

Ivan Vecera lkml netdev 8 versions – Applied

Status from this message: This series was applied to netdev/net-next.git (main)

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v8 Latest3 patches 5 repliesApplied 3/3
  2. v73 patches 11 repliesSuperseded
  3. v63 patches 6 repliesSuperseded
Earlier versions · 5
VersionPostedPatchesRepliesStatus
v53 patches1 replySuperseded
v42 patches6 repliesSuperseded
v33 patches2 repliesSuperseded
v22 patches8 repliesSuperseded
v14 patches4 repliesSuperseded

Changes in v8 from the cover letter

- Drop WARN_ON from tod_ready_wait default case and drop tie_write range guard entirely (Vadim)
- Use timespec64_valid_settod() in tod_adjust (Vadim)

Patches in v8 All 3 applied

#Subject and filesSizeRepliesApplied
1/3dpll: zl3073x: scale poll interval proportionally to timeoutdrivers/dpll/zl3073x/core.c+2 -20 repliesApplied
2/3dpll: zl3073x: add channel ToD, phase step and TIE operationsdrivers/dpll/zl3073x/chan.c drivers/dpll/zl3073x/chan.h drivers/dpll/zl3073x/core.c +2 more+439 -23 repliesApplied
3/3dpll: zl3073x: add PTP clock supportdrivers/dpll/zl3073x/Kconfig drivers/dpll/zl3073x/dpll.c drivers/dpll/zl3073x/dpll.h+422 -282 repliesApplied

Reviews trailers per patch

All 3 patches have a Reviewed-by or Acked-by.

PatchVadim FedorenkoPetr OrosChris du Quesnay
1/3R-b
2/3R-b T-b
3/3R-b R-b T-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.

Read the v8 thread

Cover letter [PATCH net-next v8 0/3] dpll: zl3073x: add PTP clock support

Add PTP hardware clock support to the zl3073x DPLL driver.

Patch 1 scales the poll sleep interval in zl3073x_poll_zero_u8() proportionally to the timeout to avoid excessive bus traffic for the longer PTP-related timeouts.

Patch 2 adds low-level channel operations for ToD read/write/adjust, output phase step, delta frequency offset write and TIE write as building blocks for PTP callbacks.

Patch 3 registers a PTP clock device for each DPLL channel with gettimex64, settime64, adjtime, adjfine, adjphase and getmaxphase callbacks. Callback availability adapts to the current channel state - adjfine requires NCO pin connected, adjphase uses TIE write when tracking a reference, and adjtime selects the appropriate mechanism automatically. Periodic output support will be added in a follow-up series.

Changes:
v8:
- Drop WARN_ON from tod_ready_wait default case and drop tie_write range guard entirely (Vadim)
- Use timespec64_valid_settod() in tod_adjust (Vadim)
v7:
- Check SEM bit before CMD in tod_ready_wait so stale CMD bits from a prior boot stage do not block ToD operations
- Move ptp_info template assignment from alloc to register to avoid stale getcycles64 pointers on devlink reload
- Update kernel-doc for tod_ready_wait, adjtime, adjtime_phase_step and tie_write to match actual return semantics
- Update poll interval changelog to mention effect on all callers
v6:
- Fix kernel-doc warning: move ZL_TOD_MAX_RETRIES define inside the function body to avoid confusing the kernel-doc parser
v5:
- Add prep patch to scale poll interval with timeout
- Enumerate all ToD commands in tod_ready_wait switch, return -EOPNOTSUPP with WARN_ON in default case (Vadim)
- Handle CMD=0 (power-on default) in tod_ready_wait
- Rewrite tod_adjust rollover guard as a retry loop that re-reads until the margin is sufficient, replacing manual fixup and fsleep
- Fix "lowest-ID synth" comments to "first enabled synth"
- Include dev_name() in PTP clock name for multi-device systems
- Update kernel-doc for adjfine/adjphase to document zero no-op
v4:
- Move out_step_time_mask to struct zl3073x_dev (device-global)
- Fix tod_adjust rollover guard for tick-crossing case
- Drop trailing tod_ready_wait from tod_adjust
- Fix TOD_CTRL register item count
- Move phase step registers into existing page 9 section in regs.h
- Align ToD command define values
- Update kernel-doc for chan_state_fetch
- Drop perout support (will rework as follow-up)
- Replace abs(delta) with explicit range check to avoid S64_MIN UB
- Add locking context doc to zl3073x_chan_df_offset_set
- Export zl3073x_chan_tod_ready_wait and wait for ToD completion in adjtime before phase step/TIE write to prevent WR_NEXT_1HZ from overwriting the sub-second adjustment
v3:
- Use PTP_1588_CLOCK instead of PTP_1588_CLOCK_OPTIONAL (Jakub)
- Factor out output pin frequency helper to a separate commit (Jakub)
- Remove spurious #include <linux/mutex.h> from dpll.h (Jakub)
v2:
- Squash low-level ops patches (1+3) into patch 1.
- Squash PTP callback patches (2+4) into patch 2, register PTP clock regardless of initial channel state.

Ivan Vecera (3):
dpll: zl3073x: scale poll interval proportionally to timeout
dpll: zl3073x: add channel ToD, phase step and TIE operations
dpll: zl3073x: add PTP clock support

 drivers/dpll/zl3073x/Kconfig |   6 +-
 drivers/dpll/zl3073x/chan.c  | 321 ++++++++++++++++++++++++-
 drivers/dpll/zl3073x/chan.h  |  32 +++
 drivers/dpll/zl3073x/core.c  |  17 +-
 drivers/dpll/zl3073x/core.h  |  23 ++
 drivers/dpll/zl3073x/dpll.c  | 439 +++++++++++++++++++++++++++++++++--
 drivers/dpll/zl3073x/dpll.h  |   5 +
 drivers/dpll/zl3073x/regs.h  |  52 +++++
 8 files changed, 863 insertions(+), 32 deletions(-)

base-commit: 4f93b12cf7b25fbf8e73d222722805b049f0a6d3

Signature · 1 line
2.54.0