.. | .. |
---|
144 | 144 | /** |
---|
145 | 145 | * e1000e_phc_getsynctime - Reads the current system/device cross timestamp |
---|
146 | 146 | * @ptp: ptp clock structure |
---|
147 | | - * @cts: structure containing timestamp |
---|
| 147 | + * @xtstamp: structure containing timestamp |
---|
148 | 148 | * |
---|
149 | 149 | * Read device and system (ART) clock simultaneously and return the scaled |
---|
150 | 150 | * clock values in ns. |
---|
.. | .. |
---|
161 | 161 | #endif/*CONFIG_E1000E_HWTS*/ |
---|
162 | 162 | |
---|
163 | 163 | /** |
---|
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 |
---|
165 | 166 | * @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 |
---|
167 | 169 | * |
---|
168 | 170 | * Read the timecounter and return the correct value in ns after converting |
---|
169 | 171 | * it into a struct timespec. |
---|
170 | 172 | **/ |
---|
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) |
---|
172 | 176 | { |
---|
173 | 177 | struct e1000_adapter *adapter = container_of(ptp, struct e1000_adapter, |
---|
174 | 178 | ptp_clock_info); |
---|
.. | .. |
---|
177 | 181 | |
---|
178 | 182 | spin_lock_irqsave(&adapter->systim_lock, flags); |
---|
179 | 183 | |
---|
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); |
---|
182 | 186 | ns = timecounter_cyc2time(&adapter->tc, cycles); |
---|
183 | 187 | |
---|
184 | 188 | spin_unlock_irqrestore(&adapter->systim_lock, flags); |
---|
.. | .. |
---|
258 | 262 | .pps = 0, |
---|
259 | 263 | .adjfreq = e1000e_phc_adjfreq, |
---|
260 | 264 | .adjtime = e1000e_phc_adjtime, |
---|
261 | | - .gettime64 = e1000e_phc_gettime, |
---|
| 265 | + .gettimex64 = e1000e_phc_gettimex, |
---|
262 | 266 | .settime64 = e1000e_phc_settime, |
---|
263 | 267 | .enable = e1000e_phc_enable, |
---|
264 | 268 | }; |
---|
.. | .. |
---|
291 | 295 | case e1000_pch_lpt: |
---|
292 | 296 | case e1000_pch_spt: |
---|
293 | 297 | case e1000_pch_cnp: |
---|
| 298 | + case e1000_pch_tgp: |
---|
| 299 | + case e1000_pch_adp: |
---|
| 300 | + case e1000_pch_mtp: |
---|
294 | 301 | if ((hw->mac.type < e1000_pch_lpt) || |
---|
295 | 302 | (er32(TSYNCRXCTL) & E1000_TSYNCRXCTL_SYSCFI)) { |
---|
296 | 303 | adapter->ptp_clock_info.max_adj = 24000000 - 1; |
---|
297 | 304 | break; |
---|
298 | 305 | } |
---|
299 | | - /* fall-through */ |
---|
| 306 | + fallthrough; |
---|
300 | 307 | case e1000_82574: |
---|
301 | 308 | case e1000_82583: |
---|
302 | 309 | adapter->ptp_clock_info.max_adj = 600000000 - 1; |
---|