From: Karol Kolacinski The offset verification work task for E822 reschedules itself if the device driver is resetting. However, it may already be executing and attempting to access the PHY when a reset has begun. Flush the work to ensure that any current execution has completed and will see the updated reset state. This avoids the potential accesses to the PHY state while resetting. It is also simpler than attempts to cancel the work which could lead to a race between the clock owner PF and the port PF. Fixes: 95af1f1c4c9f ("ice: reschedule ice_ptp_wait_for_offset_valid during reset") Signed-off-by: Karol Kolacinski Reviewed-by: Aleksandr Loktionov Signed-off-by: Arkadiusz Kubalewski Signed-off-by: Przemyslaw Korba Reviewed-by: Maciek Machnikowski Signed-off-by: Jacob Keller --- drivers/net/ethernet/intel/ice/ice_ptp.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/ethernet/intel/ice/ice_ptp.c b/drivers/net/ethernet/intel/ice/ice_ptp.c index 364f0f389d85..fccea0511eb2 100644 --- a/drivers/net/ethernet/intel/ice/ice_ptp.c +++ b/drivers/net/ethernet/intel/ice/ice_ptp.c @@ -3015,6 +3015,9 @@ void ice_ptp_prepare_for_reset(struct ice_pf *pf, enum ice_reset_req reset_type) if (reset_type == ICE_RESET_PFR) return; + if (hw->mac_type == ICE_MAC_GENERIC) + kthread_flush_work(&ptp->port.ov_work.work); + if (ice_pf_src_tmr_owned(pf) && hw->mac_type == ICE_MAC_GENERIC_3K_E825) ice_ptp_prepare_rebuild_sec(pf, false, reset_type); -- 2.56.0.rc0.395.gd1f3524e15dc