linux_dsm_epyc7002/drivers/net/ethernet/intel/e1000e
Jacob Keller aa524b66c5 e1000e: don't modify SYSTIM registers during SIOCSHWTSTAMP ioctl
The e1000e_config_hwtstamp function was incorrectly resetting the SYSTIM
registers every time the ioctl was being run. If you happened to be
running ptp4l and lost the PTP connect (removing cable, or blocking the
UDP traffic for example), then ptp4l will eventually perform a restart
which involves re-requesting timestamp settings. In e1000e this has the
unfortunate and incorrect result of resetting SYSTIME to the kernel
time. Since kernel time is usually in UTC, and PTP time is in TAI, this
results in the leap second being re-applied.

Fix this by extracting the SYSTIME reset out into its own function,
e1000e_ptp_reset, which we call during reset to restore the hardware
registers. This function will (a) restart the timecounter based on the
new system time, (b) restore the previous PPB setting, and (c) restore
the previous hwtstamp settings.

In order to perform (b), I had to modify the adjfreq ptp function
pointer to store the old delta each time it is called. This also has the
side effect of restoring the correct base timinca register correctly.
The driver does not need to explicitly zero the ptp_delta variable since
the entire adapter structure comes zero-initialized.

Reported-by: Brian Walsh <brian@walsh.ws>
Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Tested-by: Brian Walsh <brian@walsh.ws>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2016-05-13 15:30:44 -07:00
..
80003es2lan.c e1000e: use BIT() macro for bit defines 2016-05-13 15:15:36 -07:00
80003es2lan.h e1000e: Bump the version to 3.2.5 2015-06-03 04:13:39 -07:00
82571.c e1000e: use BIT() macro for bit defines 2016-05-13 15:15:36 -07:00
82571.h e1000e: Bump the version to 3.2.5 2015-06-03 04:13:39 -07:00
defines.h e1000e: Adds hardware supported cross timestamp on e1000e nic 2016-03-03 14:28:46 -08:00
e1000.h e1000e: don't modify SYSTIM registers during SIOCSHWTSTAMP ioctl 2016-05-13 15:30:44 -07:00
ethtool.c e1000e: use BIT() macro for bit defines 2016-05-13 15:15:36 -07:00
hw.h e1000e: Initial support for KabeLake 2016-02-24 14:53:30 -08:00
ich8lan.c e1000e: use BIT() macro for bit defines 2016-05-13 15:15:36 -07:00
ich8lan.h e1000e: mark shifted values as unsigned 2016-05-13 15:19:05 -07:00
mac.c e1000e: use BIT() macro for bit defines 2016-05-13 15:15:36 -07:00
mac.h e1000e: Bump the version to 3.2.5 2015-06-03 04:13:39 -07:00
Makefile e1000e: Cleanup - Update GPL header and Copyright 2014-03-07 21:55:27 -08:00
manage.c e1000e: Bump the version to 3.2.5 2015-06-03 04:13:39 -07:00
manage.h e1000e: Bump the version to 3.2.5 2015-06-03 04:13:39 -07:00
netdev.c e1000e: don't modify SYSTIM registers during SIOCSHWTSTAMP ioctl 2016-05-13 15:30:44 -07:00
nvm.c e1000e: use BIT() macro for bit defines 2016-05-13 15:15:36 -07:00
nvm.h e1000e: Bump the version to 3.2.5 2015-06-03 04:13:39 -07:00
param.c e1000e: Bump the version to 3.2.5 2015-06-03 04:13:39 -07:00
phy.c e1000e: use BIT() macro for bit defines 2016-05-13 15:15:36 -07:00
phy.h e1000e: use BIT() macro for bit defines 2016-05-13 15:15:36 -07:00
ptp.c e1000e: don't modify SYSTIM registers during SIOCSHWTSTAMP ioctl 2016-05-13 15:30:44 -07:00
regs.h e1000e: Adds hardware supported cross timestamp on e1000e nic 2016-03-03 14:28:46 -08:00