]> git.baikalelectronics.ru Git - kernel.git/commit
igc: Save PTP time before a reset
authorVinicius Costa Gomes <vinicius.gomes@intel.com>
Thu, 20 Aug 2020 23:02:17 +0000 (16:02 -0700)
committerTony Nguyen <anthony.l.nguyen@intel.com>
Mon, 28 Sep 2020 21:42:46 +0000 (14:42 -0700)
commit7c53ac5259cb87bff7c0a407e375d11b6d70aee8
tree3147c15f3e2c0d268e5bf9db65ee46e960ff1bc0
parent80654b515121d203c53a5ed3f4326846223125d6
igc: Save PTP time before a reset

Many TSN features depend on the internal PTP clock, so the internal
PTP jumping when the adapter is reset can cause problems, usually in
the form of "TX Hangs" warnings in the driver.

The solution is to save the PTP time before a reset and restore it
after the reset is done. The value of the PTP time is saved before a
reset and we use the difference from CLOCK_MONOTONIC from reset time
to now, to correct what's going to be the new PTP time.

This is heavily inspired by commit b9d62d152c81 ("i40e: save PTP time
before a device reset").

Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
drivers/net/ethernet/intel/igc/igc.h
drivers/net/ethernet/intel/igc/igc_main.c
drivers/net/ethernet/intel/igc/igc_ptp.c