Re: [PATCH net v6 2/2] ice: fix missing dpll notifications for SW pins

From: Jiri Pirko

Date: Thu Apr 16 2026 - 07:46:19 EST


Thu, Apr 16, 2026 at 01:39:52PM +0200, poros@xxxxxxxxxx wrote:
>The SMA/U.FL pin redesign (commit 2dd5d03c77e2 ("ice: redesign dpll
>sma/u.fl pins control")) introduced software-controlled pins that wrap
>backing CGU input/output pins, but never updated the notification and
>data paths to propagate pin events to these SW wrappers.
>
>The periodic work sends dpll_pin_change_ntf() only for direct CGU input
>pins. SW pins that wrap these inputs never receive change or phase
>offset notifications, so userspace consumers such as synce4l monitoring
>SMA pins via dpll netlink never learn about state transitions or phase
>offset updates. Similarly, ice_dpll_phase_offset_get() reads the SW
>pin's own phase_offset field which is never updated; the PPS monitor
>writes to the backing CGU input's field instead.
>
>On top of that, when SMA or U.FL pin state changes via PCA9575 GPIO
>write, the paired pin's state also changes because they share physical
>signal paths, but no notification is sent for the peer pin.
>
>Fix by introducing ice_dpll_pin_ntf(), a wrapper around
>dpll_pin_change_ntf() that also notifies any registered SMA/U.FL pin
>whose backing CGU input matches. Replace all direct
>dpll_pin_change_ntf() calls in the periodic notification paths with
>this wrapper. Fix ice_dpll_phase_offset_get() to return the backing
>CGU input's phase_offset for input-direction SW pins. Add
>ice_dpll_sw_pin_notify_peer() to send a notification for the paired
>SW pin after PCA9575 writes. The peer notification is called from
>the dpll_pin_ops callback wrappers after pf->dplls.lock is released,
>because dpll_pin_change_ntf() sends a netlink message that invokes
>driver callbacks which acquire the same lock.
>
>Fixes: 2dd5d03c77e2 ("ice: redesign dpll sma/u.fl pins control")
>Signed-off-by: Petr Oros <poros@xxxxxxxxxx>
>---
>v6:
> - fix deadlock reported by Michal Schmidt: dpll_pin_change_ntf() in
> peer notification was called with dpll_lock held, causing deadlock.
> Move the peer notification calls out of ice_dpll_sma_direction_set()
> and ice_dpll_ufl_pin_state_set() into their dpll_pin_ops callback
> wrappers, after pf->dplls.lock is released, and use
> __dpll_pin_change_ntf() because dpll_lock is still held by the dpll
> netlink layer (dpll_pin_pre_doit).
>v5: https://lore.kernel.org/all/20260409102501.1447628-1-poros@xxxxxxxxxx/
> - add ice_dpll_sw_pin_notify_peer() for SMA/U.FL peer notification
> when PCA9575 routing changes affect the paired pin (reported by
> Intel test: SMA state change did not log U.FL status change in
> subscribe monitor)
>v4: https://lore.kernel.org/all/20260319205256.998876-1-poros@xxxxxxxxxx/
>v3: https://lore.kernel.org/all/20260220140700.2910174-1-poros@xxxxxxxxxx/
>v2: https://lore.kernel.org/all/20260219131500.2271897-1-poros@xxxxxxxxxx/
>v1: https://lore.kernel.org/all/20260218211414.1411163-1-poros@xxxxxxxxxx/
>---
> drivers/net/ethernet/intel/ice/ice_dpll.c | 80 +++++++++++++++++++----
> 1 file changed, 68 insertions(+), 12 deletions(-)

Can this patch be split to 2? Looks like 2 fixes to me.