timekeeping: Fix CLOCK_TAI timer/nanosleep delays
authorJohn Stultz <john.stultz@linaro.org>
Wed, 11 Dec 2013 01:13:35 +0000 (17:13 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 13 Feb 2014 21:55:45 +0000 (13:55 -0800)
commit36050e26ea36f130d1c36fe51c4ffffdff49fe72
tree7cf00c01b16b7c7c8ce7cef3944e6d4d5a3ece53
parentde5cfcdd23d1001fc9348c17570ffc1f7bc0efee
timekeeping: Fix CLOCK_TAI timer/nanosleep delays

commit 04005f6011e3b504cd4d791d9769f7cb9a3b2eae upstream.

A think-o in the calculation of the monotonic -> tai time offset
results in CLOCK_TAI timers and nanosleeps to expire late (the
latency is ~2x the tai offset).

Fix this by adding the tai offset from the realtime offset instead
of subtracting.

Cc: Sasha Levin <sasha.levin@oracle.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Prarit Bhargava <prarit@redhat.com>
Cc: Richard Cochran <richardcochran@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Signed-off-by: John Stultz <john.stultz@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
kernel/time/timekeeping.c