diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2014-07-16 23:03:49 +0200 |
---|---|---|
committer | John Stultz <john.stultz@linaro.org> | 2014-07-23 19:16:50 +0200 |
commit | dc01c9fae1c5e40458c086a868d2028dfd6faebd (patch) | |
tree | 13569e1407d84fc72e6fdf902c0922a0d045306f /arch/tile/kernel/vdso | |
parent | tools: add script to test udelay (diff) | |
download | linux-dc01c9fae1c5e40458c086a868d2028dfd6faebd.tar.xz linux-dc01c9fae1c5e40458c086a868d2028dfd6faebd.zip |
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 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; |