[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20250401-jk-igc-ptm-fixes-v4-v4-3-c0efb82bbf85@intel.com>
Date: Tue, 01 Apr 2025 16:35:31 -0700
From: Jacob Keller <jacob.e.keller@...el.com>
To: Anthony Nguyen <anthony.l.nguyen@...el.com>
Cc: david.zage@...el.com, vinicius.gomes@...el.com,
rodrigo.cadore@...coustics.com, intel-wired-lan@...ts.osuosl.org,
netdev@...r.kernel.org, Jacob Keller <jacob.e.keller@...el.com>,
Christopher S M Hall <christopher.s.hall@...el.com>,
Michal Swiatkowski <michal.swiatkowski@...ux.intel.com>,
Mor Bar-Gabay <morx.bar.gabay@...el.com>,
Avigail Dahan <avigailx.dahan@...el.com>,
Corinna Vinschen <vinschen@...hat.com>
Subject: [PATCH iwl-net v4 3/6] igc: move ktime snapshot into PTM retry
loop
From: Christopher S M Hall <christopher.s.hall@...el.com>
Move ktime_get_snapshot() into the loop. If a retry does occur, a more
recent snapshot will result in a more accurate cross-timestamp.
Fixes: a90ec8483732 ("igc: Add support for PTP getcrosststamp()")
Reviewed-by: Michal Swiatkowski <michal.swiatkowski@...ux.intel.com>
Tested-by: Mor Bar-Gabay <morx.bar.gabay@...el.com>
Tested-by: Avigail Dahan <avigailx.dahan@...el.com>
Signed-off-by: Christopher S M Hall <christopher.s.hall@...el.com>
Reviewed-by: Corinna Vinschen <vinschen@...hat.com>
Signed-off-by: Jacob Keller <jacob.e.keller@...el.com>
---
drivers/net/ethernet/intel/igc/igc_ptp.c | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/drivers/net/ethernet/intel/igc/igc_ptp.c b/drivers/net/ethernet/intel/igc/igc_ptp.c
index c640e346342be80fb53e68455d510fc6491366cd..516abe7405deee94866c22ccc3d101db1a21dbb6 100644
--- a/drivers/net/ethernet/intel/igc/igc_ptp.c
+++ b/drivers/net/ethernet/intel/igc/igc_ptp.c
@@ -1011,16 +1011,16 @@ static int igc_phc_get_syncdevicetime(ktime_t *device,
int err, count = 100;
ktime_t t1, t2_curr;
- /* Get a snapshot of system clocks to use as historic value. */
- ktime_get_snapshot(&adapter->snapshot);
-
+ /* Doing this in a loop because in the event of a
+ * badly timed (ha!) system clock adjustment, we may
+ * get PTM errors from the PCI root, but these errors
+ * are transitory. Repeating the process returns valid
+ * data eventually.
+ */
do {
- /* Doing this in a loop because in the event of a
- * badly timed (ha!) system clock adjustment, we may
- * get PTM errors from the PCI root, but these errors
- * are transitory. Repeating the process returns valid
- * data eventually.
- */
+ /* Get a snapshot of system clocks to use as historic value. */
+ ktime_get_snapshot(&adapter->snapshot);
+
igc_ptm_trigger(hw);
err = readx_poll_timeout(rd32, IGC_PTM_STAT, stat,
--
2.48.1.397.gec9d649cc640
Powered by blists - more mailing lists