diff options
-rw-r--r-- | arch/tile/kernel/time.c | 9 | ||||
-rw-r--r-- | arch/tile/kernel/vdso/vgettimeofday.c | 7 |
2 files changed, 8 insertions, 8 deletions
diff --git a/arch/tile/kernel/time.c b/arch/tile/kernel/time.c index 462dcd0c1700..ae70155c2f16 100644 --- a/arch/tile/kernel/time.c +++ b/arch/tile/kernel/time.c | |||
@@ -260,7 +260,6 @@ void update_vsyscall_tz(void) | |||
260 | 260 | ||
261 | void update_vsyscall(struct timekeeper *tk) | 261 | void update_vsyscall(struct timekeeper *tk) |
262 | { | 262 | { |
263 | struct timespec wall_time = tk_xtime(tk); | ||
264 | struct timespec *wtm = &tk->wall_to_monotonic; | 263 | struct timespec *wtm = &tk->wall_to_monotonic; |
265 | struct clocksource *clock = tk->clock; | 264 | struct clocksource *clock = tk->clock; |
266 | 265 | ||
@@ -271,12 +270,12 @@ void update_vsyscall(struct timekeeper *tk) | |||
271 | ++vdso_data->tb_update_count; | 270 | ++vdso_data->tb_update_count; |
272 | smp_wmb(); | 271 | smp_wmb(); |
273 | vdso_data->xtime_tod_stamp = clock->cycle_last; | 272 | vdso_data->xtime_tod_stamp = clock->cycle_last; |
274 | vdso_data->xtime_clock_sec = wall_time.tv_sec; | 273 | vdso_data->xtime_clock_sec = tk->xtime_sec; |
275 | vdso_data->xtime_clock_nsec = wall_time.tv_nsec; | 274 | vdso_data->xtime_clock_nsec = tk->xtime_nsec; |
276 | vdso_data->wtom_clock_sec = wtm->tv_sec; | 275 | vdso_data->wtom_clock_sec = wtm->tv_sec; |
277 | vdso_data->wtom_clock_nsec = wtm->tv_nsec; | 276 | vdso_data->wtom_clock_nsec = wtm->tv_nsec; |
278 | vdso_data->mult = clock->mult; | 277 | vdso_data->mult = tk->mult; |
279 | vdso_data->shift = clock->shift; | 278 | vdso_data->shift = tk->shift; |
280 | smp_wmb(); | 279 | smp_wmb(); |
281 | ++vdso_data->tb_update_count; | 280 | ++vdso_data->tb_update_count; |
282 | } | 281 | } |
diff --git a/arch/tile/kernel/vdso/vgettimeofday.c b/arch/tile/kernel/vdso/vgettimeofday.c index 51ec8e46f5f9..e933fb9fbf5c 100644 --- a/arch/tile/kernel/vdso/vgettimeofday.c +++ b/arch/tile/kernel/vdso/vgettimeofday.c | |||
@@ -83,10 +83,11 @@ int __vdso_gettimeofday(struct timeval *tv, struct timezone *tz) | |||
83 | if (count & 1) | 83 | if (count & 1) |
84 | continue; | 84 | continue; |
85 | 85 | ||
86 | cycles = (get_cycles() - vdso_data->xtime_tod_stamp); | ||
87 | ns = (cycles * vdso_data->mult) >> vdso_data->shift; | ||
88 | sec = vdso_data->xtime_clock_sec; | 86 | sec = vdso_data->xtime_clock_sec; |
89 | ns += vdso_data->xtime_clock_nsec; | 87 | cycles = get_cycles() - vdso_data->xtime_tod_stamp; |
88 | ns = (cycles * vdso_data->mult) + vdso_data->xtime_clock_nsec; | ||
89 | ns >>= vdso_data->shift; | ||
90 | |||
90 | if (ns >= NSEC_PER_SEC) { | 91 | if (ns >= NSEC_PER_SEC) { |
91 | ns -= NSEC_PER_SEC; | 92 | ns -= NSEC_PER_SEC; |
92 | sec += 1; | 93 | sec += 1; |