hc
2023-12-11 6778948f9de86c3cfaf36725a7c87dcff9ba247f
kernel/drivers/net/ethernet/intel/e1000e/ptp.c
....@@ -144,7 +144,7 @@
144144 /**
145145 * e1000e_phc_getsynctime - Reads the current system/device cross timestamp
146146 * @ptp: ptp clock structure
147
- * @cts: structure containing timestamp
147
+ * @xtstamp: structure containing timestamp
148148 *
149149 * Read device and system (ART) clock simultaneously and return the scaled
150150 * clock values in ns.
....@@ -161,14 +161,18 @@
161161 #endif/*CONFIG_E1000E_HWTS*/
162162
163163 /**
164
- * e1000e_phc_gettime - Reads the current time from the hardware clock
164
+ * e1000e_phc_gettimex - Reads the current time from the hardware clock and
165
+ * system clock
165166 * @ptp: ptp clock structure
166
- * @ts: timespec structure to hold the current time value
167
+ * @ts: timespec structure to hold the current PHC time
168
+ * @sts: structure to hold the current system time
167169 *
168170 * Read the timecounter and return the correct value in ns after converting
169171 * it into a struct timespec.
170172 **/
171
-static int e1000e_phc_gettime(struct ptp_clock_info *ptp, struct timespec64 *ts)
173
+static int e1000e_phc_gettimex(struct ptp_clock_info *ptp,
174
+ struct timespec64 *ts,
175
+ struct ptp_system_timestamp *sts)
172176 {
173177 struct e1000_adapter *adapter = container_of(ptp, struct e1000_adapter,
174178 ptp_clock_info);
....@@ -177,8 +181,8 @@
177181
178182 spin_lock_irqsave(&adapter->systim_lock, flags);
179183
180
- /* Use timecounter_cyc2time() to allow non-monotonic SYSTIM readings */
181
- cycles = adapter->cc.read(&adapter->cc);
184
+ /* NOTE: Non-monotonic SYSTIM readings may be returned */
185
+ cycles = e1000e_read_systim(adapter, sts);
182186 ns = timecounter_cyc2time(&adapter->tc, cycles);
183187
184188 spin_unlock_irqrestore(&adapter->systim_lock, flags);
....@@ -258,7 +262,7 @@
258262 .pps = 0,
259263 .adjfreq = e1000e_phc_adjfreq,
260264 .adjtime = e1000e_phc_adjtime,
261
- .gettime64 = e1000e_phc_gettime,
265
+ .gettimex64 = e1000e_phc_gettimex,
262266 .settime64 = e1000e_phc_settime,
263267 .enable = e1000e_phc_enable,
264268 };
....@@ -291,12 +295,15 @@
291295 case e1000_pch_lpt:
292296 case e1000_pch_spt:
293297 case e1000_pch_cnp:
298
+ case e1000_pch_tgp:
299
+ case e1000_pch_adp:
300
+ case e1000_pch_mtp:
294301 if ((hw->mac.type < e1000_pch_lpt) ||
295302 (er32(TSYNCRXCTL) & E1000_TSYNCRXCTL_SYSCFI)) {
296303 adapter->ptp_clock_info.max_adj = 24000000 - 1;
297304 break;
298305 }
299
- /* fall-through */
306
+ fallthrough;
300307 case e1000_82574:
301308 case e1000_82583:
302309 adapter->ptp_clock_info.max_adj = 600000000 - 1;