RE: [PATCH iwl-net 02/12] ice: E822: keep Tx timestamps disabled during offset calibration

"Nowlin, Alexander" <[email protected]>
Newsgroups org.osuosl.intel-wired-lan,org.kernel.vger.netdev
Message-ID <LV1PR11MB879096CD257FD128205F4A0890A22@LV1PR11MB8790.namprd11.prod.outlook.com>
> -----Original Message-----
> From: Keller, Jacob E <[email protected]> 
> Sent: Friday, August 21, 2026 5:13 PM
> To: Intel Wired LAN <[email protected]>
> Cc: [email protected]; Machnikowski, Maciej <[email protected]>; Nguyen, Anthony L <[email protected]>; Korba, Przemyslaw <[email protected]>; Nitka, Grzegorz <[email protected]>; Oros, Petr <[email protected]>; Nowlin, Alexander <[email protected]>; Bross, Kevin <[email protected]>; Cavatur, Ranjit <[email protected]>; Keller, Jacob E <[email protected]>; Karol Kolacinski <[email protected]>; Loktionov, Aleksandr <[email protected]>; Kubalewski, Arkadiusz <[email protected]>; Korba, Przemyslaw <[email protected]>
> Subject: [PATCH iwl-net 02/12] ice: E822: keep Tx timestamps disabled during offset calibration
> 
> From: Karol Kolacinski <[email protected]>
> 
> Do not clear the tx.calibrating flag immediately after starting the PHY timer in ice_ptp_port_phy_restart(). Instead, keep Tx timestamps disabled until the offset verification work (ice_ptp_wait_for_offsets) has confirmed that both Tx and Rx PHY offsets are properly configured.
> 
> Previously, tx.calibrating was set to true, then immediately back to false right after ice_start_phy_timer_e82x() returned. This allowed Tx timestamp requests to be served during the window where offset verification was still pending. Timestamps produced during this window use uncalibrated PHY offsets and can produce incorrect values.
> 
> When ptp4l receives incorrect timestamps, it may reject them and wait for the next sync interval (typically 1-2 seconds), compounding delays during link cycling. This contributes to the time transmitter port becoming unresponsive after repeated link down/up cycles.
> 
> Move the tx.calibrating = false to ice_ptp_wait_for_offsets(), after both Tx and Rx offset configuration has completed successfully. This ensures that Tx timestamps are only reported with properly calibrated PHY > offsets.
> 
> If ice_start_phy_timer_e82x() fails, restore calibrating to false on the error path to prevent permanently disabling Tx timestamps when ov_work is never queued.
> 
> Log a debug message while offset calibration is still pending, including the specific Tx/Rx error codes to aid debugging stalled calibration.
> This path is expected on every routine link-up: ov_work is first queued with no delay and the vernier offset cannot be computed until at least one packet has been transmitted, so the first several invocations normally land here. Use dev_dbg() rather than a rate-limited warning to avoid emitting KERN_WARNING on every link-up during normal operation.
> Log a debug message when calibration completes successfully.
> 
> Fixes: 3a7496234d17 ("ice: implement basic E822 PTP support")
> Signed-off-by: Karol Kolacinski <[email protected]>
> Reviewed-by: Aleksandr Loktionov <[email protected]>
> Signed-off-by: Arkadiusz Kubalewski <[email protected]>
> Signed-off-by: Przemyslaw Korba <[email protected]>
> ---
>  drivers/net/ethernet/intel/ice/ice_ptp.c | 36 ++++++++++++++++++++++++++------
>  1 file changed, 30 insertions(+), 6 deletions(-)

Tested-by: Alexander Nowlin <[email protected]>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.