]> git.baikalelectronics.ru Git - kernel.git/commit
arm64: vdso: defer shifting of nanosecond component of timespec
authorWill Deacon <will.deacon@arm.com>
Thu, 29 Nov 2012 22:33:29 +0000 (22:33 +0000)
committerCatalin Marinas <catalin.marinas@arm.com>
Wed, 5 Dec 2012 11:20:03 +0000 (11:20 +0000)
commitc3a8aa7139d21ba1066cb95e9fb2753a7b455536
tree93b60ea0b2c3daf94b50dfa3125b2a3c59a0ff1b
parentcdadbdeb02a7f148ca601251a3ff3ba78e18bb73
arm64: vdso: defer shifting of nanosecond component of timespec

Shifting the nanosecond component of the computed timespec early can
lead to sub-ns inaccuracies when using the truncated value as input to
further arithmetic for things like conversions to monotonic time.

This patch defers the timespec shifting until after the final value has
been computed.

Reported-by: John Stultz <john.stultz@linaro.org>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
arch/arm64/kernel/vdso.c
arch/arm64/kernel/vdso/gettimeofday.S