]> git.baikalelectronics.ru Git - kernel.git/commit
ice: Don't put stale timestamps in the skb
authorKarol Kolacinski <karol.kolacinski@intel.com>
Tue, 16 Nov 2021 12:07:14 +0000 (13:07 +0100)
committerTony Nguyen <anthony.l.nguyen@intel.com>
Tue, 14 Dec 2021 19:31:47 +0000 (11:31 -0800)
commit48110dbdbe1f2fd0209a5b70730ba96093202a6e
tree9c7478d340257147f631478733a6aadbe2685419
parent24c9c1aceedccb8c336bd7688472018c80d12ad6
ice: Don't put stale timestamps in the skb

The driver has to check if it does not accidentally put the timestamp in
the SKB before previous timestamp gets overwritten.
Timestamp values in the PHY are read only and do not get cleared except
at hardware reset or when a new timestamp value is captured.
The cached_tstamp field is used to detect the case where a new timestamp
has not yet been captured, ensuring that we avoid sending stale
timestamp data to the stack.

Fixes: fd28ad3fe698 ("ice: enable transmit timestamps for E810 devices")
Signed-off-by: Karol Kolacinski <karol.kolacinski@intel.com>
Tested-by: Gurucharan G <gurucharanx.g@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
drivers/net/ethernet/intel/ice/ice_ptp.c
drivers/net/ethernet/intel/ice/ice_ptp.h