Re: [PATCH net-next v3 2/2] dpll: use pin owner's dpll ref for pin-level attribute setting
Jiri Pirko <[email protected]>
| Newsgroups | org.kernel.vger.linux-doc,org.kernel.vger.linux-kernel,org.kernel.vger.netdev |
|---|---|
| Message-ID | <anb91_uhQWVz_oMh@FV6GYCPJ69> |
Fri, Aug 07, 2026 at 11:59:26AM +0200, [email protected] wrote: >Pin-level attributes (frequency, phase adjust, embedded sync, reference >sync) are properties of the pin itself, not of a particular DPLL device. >The get callbacks already use only the pin owner's DPLL reference >(via dpll_pin_own_dpll_ref_first()), but the set callbacks iterate over >all registered DPLL references and invoke the set operation on each one. > >This is redundant because a pin is a single physical entity - setting >its frequency or phase adjust once through the owner's ops is sufficient. >Calling set on every registered DPLL just results in duplicate HW writes >for drivers that share a pin across multiple DPLL devices (e.g. ice >registers each input pin with both the EEC and PPS DPLL, zl3073x >registers input pins with every DPLL channel). > >Simplify dpll_pin_freq_set(), dpll_pin_esync_set(), >dpll_pin_ref_sync_state_set() and dpll_pin_phase_adj_set() to call the >set callback only through the owner's DPLL reference, matching the >existing get-side behavior. This removes the xa_for_each iteration >loops, the now-unnecessary rollback logic, and several local variables. > >The -EOPNOTSUPP validation loop, which checked ops support across all >owner-matching references, is replaced with a direct check on the >single owner reference returned by dpll_pin_own_dpll_ref_first(). > >The documentation in dpll.rst is updated to reflect that pin-level >attributes are set through the pin owner's dpll reference only. > >No existing driver is affected: > - ptp_ocp and mlx5 register each pin with a single DPLL. > - ice registers input pins with two DPLLs (EEC and PPS) using > identical ops and pin_priv; the set callbacks address the HW by > pin index, not by DPLL, so the second call was a no-op. > - zl3073x registers input pins with every DPLL channel; the set > callbacks address HW by pin/ref ID regardless of DPLL. The > ref_sync_set callback was the only one with per-channel behavior, > addressed by the preceding patch. > >Signed-off-by: Ivan Vecera <[email protected]> Reviewed-by: Jiri Pirko <[email protected]>