diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2014-07-16 21:03:49 (GMT) |
---|---|---|
committer | John Stultz <john.stultz@linaro.org> | 2014-07-23 17:16:50 (GMT) |
commit | dc01c9fae1c5e40458c086a868d2028dfd6faebd (patch) | |
tree | 13569e1407d84fc72e6fdf902c0922a0d045306f /arch/tile/kernel/vdso | |
parent | 988b0c541ed8b1c633c4d4df7169010635942e18 (diff) | |
download | linux-dc01c9fae1c5e40458c086a868d2028dfd6faebd.tar.xz |
tile: Convert VDSO timekeeping to the precise mechanism
The code was only halfarsed converted to the new VSDO update mechanism
and still uses the inaccurate base value which lacks the fractional
part of xtime_nsec. Fix it up.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: John Stultz <john.stultz@linaro.org>
Diffstat (limited to 'arch/tile/kernel/vdso')
-rw-r--r-- | arch/tile/kernel/vdso/vgettimeofday.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/arch/tile/kernel/vdso/vgettimeofday.c b/arch/tile/kernel/vdso/vgettimeofday.c index 51ec8e4..e933fb9 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) if (count & 1) continue; - cycles = (get_cycles() - vdso_data->xtime_tod_stamp); - ns = (cycles * vdso_data->mult) >> vdso_data->shift; sec = vdso_data->xtime_clock_sec; - ns += vdso_data->xtime_clock_nsec; + cycles = get_cycles() - vdso_data->xtime_tod_stamp; + ns = (cycles * vdso_data->mult) + vdso_data->xtime_clock_nsec; + ns >>= vdso_data->shift; + if (ns >= NSEC_PER_SEC) { ns -= NSEC_PER_SEC; sec += 1; |