]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
dpll: zl3073x: report FFO as DPLL vs input reference offset
authorIvan Vecera <ivecera@redhat.com>
Mon, 11 May 2026 15:58:16 +0000 (17:58 +0200)
committerJakub Kicinski <kuba@kernel.org>
Wed, 13 May 2026 01:48:07 +0000 (18:48 -0700)
commit54e65df8cf18a741745645aed7ae91514d437b43
tree5ddede51bd7aeffd51f82b03aa5b8cbd56d9508d
parent9c11fcb2e9a54d0f1467380831e2e4bb68f7498d
dpll: zl3073x: report FFO as DPLL vs input reference offset

Replace the per-reference frequency offset measurement (which was
redundant with measured-frequency) with a direct read of the DPLL's
delta frequency offset vs its tracked input reference.

The new implementation uses the dpll_df_offset_x register with
ref_ofst=1 via the dpll_df_read_x semaphore mechanism. This
provides 2^-48 resolution (~3.5 fE) and reports the actual
frequency difference between the DPLL and its active input.

Switch supported_ffo from DPLL_FFO_PORT_RXTX_RATE to
DPLL_FFO_PIN_DEVICE so FFO is reported only in the per-parent
context for the active input pin.

Use atomic64_t for freq_offset to prevent torn reads on 32-bit
architectures between the periodic worker and netlink callbacks.

Rewrite ffo_check to compare the cached df_offset converted to PPT
instead of using the old per-reference measurement. Remove the
ref_ffo_update periodic measurement and the ref ffo field since
they are no longer needed.

Changes v3 -> v4:
- Switch to DPLL_FFO_PIN_DEVICE, remove dpll=NULL guard
- Use atomic64_t for freq_offset (torn read on 32-bit)

Reviewed-by: Petr Oros <poros@redhat.com>
Signed-off-by: Ivan Vecera <ivecera@redhat.com>
Link: https://patch.msgid.link/20260511155816.99936-3-ivecera@redhat.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/dpll/zl3073x/chan.c
drivers/dpll/zl3073x/chan.h
drivers/dpll/zl3073x/core.c
drivers/dpll/zl3073x/dpll.c
drivers/dpll/zl3073x/ref.h
drivers/dpll/zl3073x/regs.h