]> 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)
commit6074c22f3812cb829f941f6695ff6a85eef7f650
tree9c7478d340257147f631478733a6aadbe2685419
parentb753a9dad2d53de31bcb197b82d718c49c98fba0
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: af3f04b49ed3 ("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