summaryrefslogtreecommitdiffstats
path: root/arch/tile/kernel/vdso
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2014-07-16 21:03:49 +0000
committerJohn Stultz <john.stultz@linaro.org>2014-07-23 10:16:50 -0700
commitdc01c9fae1c5e40458c086a868d2028dfd6faebd (patch)
tree13569e1407d84fc72e6fdf902c0922a0d045306f /arch/tile/kernel/vdso
parent988b0c541ed8b1c633c4d4df7169010635942e18 (diff)
downloadlinux-dc01c9fae1c5e40458c086a868d2028dfd6faebd.tar.bz2
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.c7
1 files changed, 4 insertions, 3 deletions
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)
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;