@@ -381,23 +381,31 @@ static inline u64 timekeeping_delta_to_ns(const struct tk_read_base *tkr, u64 de
381
381
return nsec ;
382
382
}
383
383
384
- static inline u64 timekeeping_get_ns (const struct tk_read_base * tkr )
384
+ static inline u64 timekeeping_cycles_to_ns (const struct tk_read_base * tkr , u64 cycles )
385
385
{
386
386
u64 delta ;
387
387
388
- delta = timekeeping_get_delta (tkr );
388
+ /* calculate the delta since the last update_wall_time */
389
+ delta = clocksource_delta (cycles , tkr -> cycle_last , tkr -> mask );
389
390
return timekeeping_delta_to_ns (tkr , delta );
390
391
}
391
392
392
- static inline u64 timekeeping_cycles_to_ns ( const struct tk_read_base * tkr , u64 cycles )
393
+ static __always_inline u64 fast_tk_get_delta_ns ( struct tk_read_base * tkr )
393
394
{
394
- u64 delta ;
395
+ u64 delta , cycles = tk_clock_read ( tkr ) ;
395
396
396
- /* calculate the delta since the last update_wall_time */
397
397
delta = clocksource_delta (cycles , tkr -> cycle_last , tkr -> mask );
398
398
return timekeeping_delta_to_ns (tkr , delta );
399
399
}
400
400
401
+ static inline u64 timekeeping_get_ns (const struct tk_read_base * tkr )
402
+ {
403
+ u64 delta ;
404
+
405
+ delta = timekeeping_get_delta (tkr );
406
+ return timekeeping_delta_to_ns (tkr , delta );
407
+ }
408
+
401
409
/**
402
410
* update_fast_timekeeper - Update the fast and NMI safe monotonic timekeeper.
403
411
* @tkr: Timekeeping readout base from which we take the update
@@ -431,14 +439,6 @@ static void update_fast_timekeeper(const struct tk_read_base *tkr,
431
439
memcpy (base + 1 , base , sizeof (* base ));
432
440
}
433
441
434
- static __always_inline u64 fast_tk_get_delta_ns (struct tk_read_base * tkr )
435
- {
436
- u64 delta , cycles = tk_clock_read (tkr );
437
-
438
- delta = clocksource_delta (cycles , tkr -> cycle_last , tkr -> mask );
439
- return timekeeping_delta_to_ns (tkr , delta );
440
- }
441
-
442
442
static __always_inline u64 __ktime_get_fast_ns (struct tk_fast * tkf )
443
443
{
444
444
struct tk_read_base * tkr ;
0 commit comments