Skip to contentSkip to conversation

ice/ptp: Fix reporting of crosstimestamp

PATCH Superseded Anton Nadezhdin 3 participants 3 messages May 8, 2025 – May 9, 2025

Subsystems (2)

v1 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ice/ptp: Fix reporting of crosstimestamp

Set use_nsecs=true as timestamp is reported in ns. Lack of this result in smaller timestamp error window which case error during phc2sys execution on some platforms:
phc2sys[1768.256]: ioctl PTP_SYS_OFFSET_PRECISE: Invalid argument

Previously function convert_art_to_tsc was converting ts to the cycles instead of ns.

Testing hints (ethX is PF netdev):
phc2sys -s ethX -c CLOCK_REALTIME -O 37 -m

Fixes d4bea547ebb57 (ice/ptp: Remove convert_art_to_tsc())
---
 drivers/net/ethernet/intel/ice/ice_ptp.c | 1 +
 1 file changed, 1 insertion(+)
drivers/net/ethernet/intel/ice/ice_ptp.c +1 -0
index 1fd1ae03eb90..11ed48a62b53 100644
@@ -2307,6 +2307,7 @@ static int ice_capture_crosststamp(ktime_t *device,
 	ts = ((u64)ts_hi << 32) | ts_lo;
 	system->cycles = ts;
 	system->cs_id = CSID_X86_ART;
+	system->use_nsecs = true;
 
 	/* Read Device source clock time */
 	ts_lo = rd32(hw, cfg->dev_time_l[tmr_idx]);

base-commit: 7e5af365e38059ed585917623c1ba3a6c04a8c10

Signature · 1 line
2.34.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 16 lines

-----Original Message-----
From: Intel-wired-lan <[email protected]> On Behalf Of Anton Nadezhdin
Sent: Thursday, May 8, 2025 2:53 PM
To: [email protected]
Cc: Nadezhdin, Anton <[email protected]>
Subject: [Intel-wired-lan] [PATCH iwl-net] ice/ptp: Fix reporting of crosstimestamp

Set use_nsecs=true as timestamp is reported in ns. Lack of this result in smaller timestamp error window which case error during phc2sys execution on some platforms:
phc2sys[1768.256]: ioctl PTP_SYS_OFFSET_PRECISE: Invalid argument

Quoted 8 lines

Previously function convert_art_to_tsc was converting ts to the cycles instead of ns.

Testing hints (ethX is PF netdev):
phc2sys -s ethX -c CLOCK_REALTIME -O 37 -m

Fixes d4bea547ebb57 (ice/ptp: Remove convert_art_to_tsc())
Quoted 22 lines
---
 drivers/net/ethernet/intel/ice/ice_ptp.c | 1 +
 1 file changed, 1 insertion(+)
drivers/net/ethernet/intel/ice/ice_ptp.c +1 -0
index 1fd1ae03eb90..11ed48a62b53 100644
@@ -2307,6 +2307,7 @@ static int ice_capture_crosststamp(ktime_t
 *device,
 	ts = ((u64)ts_hi << 32) | ts_lo;
 	system->cycles = ts;
 	system->cs_id = CSID_X86_ART;
+	system->use_nsecs = true;
 
 	/* Read Device source clock time */

ts_lo = rd32(hw, cfg->dev_time_l[tmr_idx]);

base-commit: 7e5af365e38059ed585917623c1ba3a6c04a8c10 --
2.34.1

maintainer
#2 lore raw
In reply to Anton Nadezhdin
Quoted 1 line · Anton Nadezhdin

Set use_nsecs=true as timestamp is reported in ns. Lack of this result

results

Quoted 1 line

in smaller timestamp error window which case error during phc2sys

window, what causes

Quoted 11 lines

execution on some platforms:
phc2sys[1768.256]: ioctl PTP_SYS_OFFSET_PRECISE: Invalid argument

Previously function convert_art_to_tsc was converting ts to the cycles instead of ns.

Testing hints (ethX is PF netdev):
phc2sys -s ethX -c CLOCK_REALTIME -O 37 -m

Fixes d4bea547ebb57 (ice/ptp: Remove convert_art_to_tsc())

the change by itself looks good, please read [1] before sending v2
[1] https://wiki.ith.intel.com/x/ShT8vQ
(intel-workers-only link about our process)

Quoted 18 lines
---
  drivers/net/ethernet/intel/ice/ice_ptp.c | 1 +
  1 file changed, 1 insertion(+)
drivers/net/ethernet/intel/ice/ice_ptp.c +1 -0
index 1fd1ae03eb90..11ed48a62b53 100644
@@ -2307,6 +2307,7 @@ static int ice_capture_crosststamp(ktime_t *device,
  	ts = ((u64)ts_hi << 32) | ts_lo;
  	system->cycles = ts;
  	system->cs_id = CSID_X86_ART;
+	system->use_nsecs = true;
 
  	/* Read Device source clock time */
  	ts_lo = rd32(hw, cfg->dev_time_l[tmr_idx]);

base-commit: 7e5af365e38059ed585917623c1ba3a6c04a8c10