From: Grzegorz Nitka <grze…@intel.com> The cross-timestamp capture path programs GLTSYN_CMD with READ_TIME before starting the ART/device capture and clears it with NOP afterwards. Since GLTSYN_CMD is shared with other PTP operations, concurrent executions will race and cause desync across PHY timers causing PHY timestamps to be incorrect and resulting in faulty PTP behavior. Remove the redundant source command programming instead of adding another guard around it. This was found on an early pre-production stepping of a device, and it was assumed that it would be required for all E823 devices. We discovered that this isn't actually required on E823 production devices as originally believed. The only device SKUs that actually require this are pre-production and have device IDs which aren't supported by the driver. We tested this across a wide array of E823 silicon steppings. Testing hints: Verify crosstimestamp path, for example with phc2sys tool, on E822/E823/E825/E830 devices. Please note that the phc2sys tool performs cross-timestamping by default when supported by the hardware. This can be observed when the reported delay is 0, indicating that the system time and PHC time were latched simultaneously. Fixes: 88c360e49f51 ("ice: Support cross-timestamping for E823 devices") Signed-off-by: Grzegorz Nitka <grze…@intel.com> Reviewed-by: Sergey Temerkhanov <serg…@intel.com> Reviewed-by: Milena Olech <mile…@intel.com> Reviewed-by: Simon Horman <hor…@kernel.org> Reviewed-by: Aleksandr Loktionov <alek…@intel.com> Tested-by: Ayush Singh <ayus…@intel.com> (A Contingent worker at Intel) Signed-off-by: Tony Nguyen <anth…@intel.com> --- drivers/net/ethernet/intel/ice/ice_ptp.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/drivers/net/ethernet/intel/ice/ice_ptp.c b/drivers/net/ethernet/intel/ice/ice_ptp.c index 8908b4f3db35..db1d0e42ae52 100644 --- a/drivers/net/ethernet/intel/ice/ice_ptp.c +++ b/drivers/net/ethernet/intel/ice/ice_ptp.c @@ -2183,9 +2183,6 @@ static int ice_capture_crosststamp(ktime_t *device, /* Snapshot system time for historic interpolation */ ktime_get_snapshot_id(ctx->snapshot_clock_id, &ctx->snapshot); - /* Program cmd to master timer */ - ice_ptp_src_cmd(hw, ICE_PTP_READ_TIME); - /* Start the ART and device clock sync sequence */ ctl = rd32(hw, cfg->ctl_reg); ctl |= cfg->ctl_active; @@ -2212,9 +2209,6 @@ static int ice_capture_crosststamp(ktime_t *device, *device = ns_to_ktime(ts); err_timeout: - /* Clear the master timer */ - ice_ptp_src_cmd(hw, ICE_PTP_NOP); - /* Release HW lock */ lock = rd32(hw, cfg->lock_reg); lock &= ~cfg->lock_busy;
-- 2.47.1