RE: [Intel-wired-lan] [PATCH v3 iwl-next 1/3] ice: monitor TSPLL lock from PTP periodic worker

From: Nowlin, Alexander

Date: Wed Sep 02 2026 - 12:28:22 EST


> -----Original Message-----
> From: Intel-wired-lan <intel-wired-lan-bounces@xxxxxxxxxx> On Behalf Of Grzegorz Nitka
> Sent: Monday, August 3, 2026 4:35 AM
> To: intel-wired-lan@xxxxxxxxxxxxxxxx
> Cc: Kitszel, Przemyslaw <przemyslaw.kitszel@xxxxxxxxx>; richardcochran@xxxxxxxxx; linux-kernel@xxxxxxxxxxxxxxx; Kubalewski, Arkadiusz <arkadiusz.kubalewski@xxxxxxxxx>; Korba, Przemyslaw <przemyslaw.korba@xxxxxxxxx>; andrew+netdev@xxxxxxx; edumazet@xxxxxxxxxx; Nguyen, Anthony L <anthony.l.nguyen@xxxxxxxxx>; netdev@xxxxxxxxxxxxxxx; kuba@xxxxxxxxxx; pabeni@xxxxxxxxxx; davem@xxxxxxxxxxxxx
> Subject: [Intel-wired-lan] [PATCH v3 iwl-next 1/3] ice: monitor TSPLL lock from PTP periodic worker
>
> On E825 devices that own the source timer, the TSPLL can lose lock when the TCXO or TIME_REF signal is disrupted. Recovery requires re-enabling the TSPLL via CGU register writes; without it, the PHC keeps running on a degraded reference indefinitely.
>
> The DPLL periodic worker (ice_dpll_periodic_work()) would be a natural home for this monitoring, but placing it there has two problems:
>
> 1. ice_dpll_init_e825() sets ICE_FLAG_DPLL only after all initialization
> steps succeed. If any earlier step fails, the driver would run
> without any TSPLL recovery mechanism.
>
> 2. When CONFIG_DPLL=n, the DPLL worker is compiled out and TSPLL
> recovery would be silently absent.
>
> Add the monitor to ice_ptp_periodic_work() instead, which always runs on
> E825 owner PFs regardless of DPLL init state or config. Introduce two small helpers, ice_tspll_lost_lock_e825c() and ice_tspll_restart_e825c(), which encapsulate the CGU register reads/writes required to observe and recover the TSPLL.
>
> Cache the observed lock state in pf->ptp.tspll_locked using
> WRITE_ONCE()/READ_ONCE() so a follow-up change can consume it from the DPLL periodic worker (for user-space notification via
> dpll_device_change_ntf()) and drop the redundant poll+recovery from that path. Precise synchronization is not required: both workers converge on the same value within one poll period.
>
> Reviewed-by: Przemyslaw Korba <przemyslaw.korba@xxxxxxxxx>
> Signed-off-by: Grzegorz Nitka <grzegorz.nitka@xxxxxxxxx>
> ---
> drivers/net/ethernet/intel/ice/ice_ptp.c | 70 +++++++++++++++++
> drivers/net/ethernet/intel/ice/ice_ptp.h | 11 +++
> drivers/net/ethernet/intel/ice/ice_tspll.c | 88 +++++++++++++++++++++- drivers/net/ethernet/intel/ice/ice_tspll.h | 4 +
> 4 files changed, 172 insertions(+), 1 deletion(-)

Tested-by: Alexander Nowlin <alexander.nowlin@xxxxxxxxx>