diff options
-rw-r--r-- | arch/x86/include/asm/timer.h | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/arch/x86/include/asm/timer.h b/arch/x86/include/asm/timer.h index 34baa0eb5d0c..10a78c037910 100644 --- a/arch/x86/include/asm/timer.h +++ b/arch/x86/include/asm/timer.h | |||
@@ -4,6 +4,7 @@ | |||
4 | #include <linux/pm.h> | 4 | #include <linux/pm.h> |
5 | #include <linux/percpu.h> | 5 | #include <linux/percpu.h> |
6 | #include <linux/interrupt.h> | 6 | #include <linux/interrupt.h> |
7 | #include <linux/math64.h> | ||
7 | 8 | ||
8 | #define TICK_SIZE (tick_nsec / 1000) | 9 | #define TICK_SIZE (tick_nsec / 1000) |
9 | 10 | ||
@@ -57,10 +58,8 @@ DECLARE_PER_CPU(unsigned long long, cyc2ns_offset); | |||
57 | 58 | ||
58 | static inline unsigned long long __cycles_2_ns(unsigned long long cyc) | 59 | static inline unsigned long long __cycles_2_ns(unsigned long long cyc) |
59 | { | 60 | { |
60 | int cpu = smp_processor_id(); | 61 | unsigned long long ns = this_cpu_read(cyc2ns_offset); |
61 | unsigned long long ns = per_cpu(cyc2ns_offset, cpu); | 62 | ns += mul_u64_u32_shr(cyc, this_cpu_read(cyc2ns), CYC2NS_SCALE_FACTOR); |
62 | ns += mult_frac(cyc, per_cpu(cyc2ns, cpu), | ||
63 | (1UL << CYC2NS_SCALE_FACTOR)); | ||
64 | return ns; | 63 | return ns; |
65 | } | 64 | } |
66 | 65 | ||