]> git.baikalelectronics.ru Git - kernel.git/commit
ixgbe: stop resetting SYSTIME in ixgbe_ptp_start_cyclecounter
authorJacob Keller <jacob.e.keller@intel.com>
Tue, 2 Aug 2022 00:24:19 +0000 (17:24 -0700)
committerTony Nguyen <anthony.l.nguyen@intel.com>
Wed, 24 Aug 2022 19:21:10 +0000 (12:21 -0700)
commit7382b914c5050f077d239bf2ad261e7f7213fbb0
tree9ed745140bf9cbdf6923f5134644f440d2a3ac96
parent778b9e02ac5d7ccc8fd418fd5fe739e67ac9049d
ixgbe: stop resetting SYSTIME in ixgbe_ptp_start_cyclecounter

The ixgbe_ptp_start_cyclecounter is intended to be called whenever the
cyclecounter parameters need to be changed.

Since commit 8b95512ad51a ("ixgbe: Update PTP to support X550EM_x
devices"), this function has cleared the SYSTIME registers and reset the
TSAUXC DISABLE_SYSTIME bit.

While these need to be cleared during ixgbe_ptp_reset, it is wrong to clear
them during ixgbe_ptp_start_cyclecounter. This function may be called
during both reset and link status change. When link changes, the SYSTIME
counter is still operating normally, but the cyclecounter should be updated
to account for the possibly changed parameters.

Clearing SYSTIME when link changes causes the timecounter to jump because
the cycle counter now reads zero.

Extract the SYSTIME initialization out to a new function and call this
during ixgbe_ptp_reset. This prevents the timecounter adjustment and avoids
an unnecessary reset of the current time.

This also restores the original SYSTIME clearing that occurred during
ixgbe_ptp_reset before the commit above.

Reported-by: Steve Payne <spayne@aurora.tech>
Reported-by: Ilya Evenbach <ievenbach@aurora.tech>
Fixes: 8b95512ad51a ("ixgbe: Update PTP to support X550EM_x devices")
Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Tested-by: Gurucharan <gurucharanx.g@intel.com> (A Contingent worker at Intel)
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
drivers/net/ethernet/intel/ixgbe/ixgbe_ptp.c