From: Greg Kroah-Hartman Date: Tue, 11 Feb 2014 17:57:50 +0000 (-0800) Subject: 3.12-stable patches X-Git-Tag: v3.4.80~15 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=06b2bb4d7ccaafb3d77ac6c613f4456e0421cd31;p=thirdparty%2Fkernel%2Fstable-queue.git 3.12-stable patches added patches: timekeeping-fix-clock_tai-timer-nanosleep-delays.patch --- diff --git a/queue-3.12/series b/queue-3.12/series index c75369b231f..39cd43ead14 100644 --- a/queue-3.12/series +++ b/queue-3.12/series @@ -100,3 +100,4 @@ timekeeping-fix-lost-updates-to-tai-adjustment.patch timekeeping-fix-potential-lost-pv-notification-of-time-change.patch timekeeping-avoid-possible-deadlock-from-clock_was_set_delayed.patch 3.13.y-timekeeping-fix-clock_set-clock_was_set-think-o.patch +timekeeping-fix-clock_tai-timer-nanosleep-delays.patch diff --git a/queue-3.12/timekeeping-fix-clock_tai-timer-nanosleep-delays.patch b/queue-3.12/timekeeping-fix-clock_tai-timer-nanosleep-delays.patch new file mode 100644 index 00000000000..f1865a534cd --- /dev/null +++ b/queue-3.12/timekeeping-fix-clock_tai-timer-nanosleep-delays.patch @@ -0,0 +1,48 @@ +From 04005f6011e3b504cd4d791d9769f7cb9a3b2eae Mon Sep 17 00:00:00 2001 +From: John Stultz +Date: Tue, 10 Dec 2013 17:13:35 -0800 +Subject: timekeeping: Fix CLOCK_TAI timer/nanosleep delays + +From: John Stultz + +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 +Cc: Thomas Gleixner +Cc: Prarit Bhargava +Cc: Richard Cochran +Cc: Ingo Molnar +Signed-off-by: John Stultz +Signed-off-by: Greg Kroah-Hartman + +--- + kernel/time/timekeeping.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/kernel/time/timekeeping.c ++++ b/kernel/time/timekeeping.c +@@ -77,7 +77,7 @@ static void tk_set_wall_to_mono(struct t + tk->wall_to_monotonic = wtm; + set_normalized_timespec(&tmp, -wtm.tv_sec, -wtm.tv_nsec); + tk->offs_real = timespec_to_ktime(tmp); +- tk->offs_tai = ktime_sub(tk->offs_real, ktime_set(tk->tai_offset, 0)); ++ tk->offs_tai = ktime_add(tk->offs_real, ktime_set(tk->tai_offset, 0)); + } + + static void tk_set_sleep_time(struct timekeeper *tk, struct timespec t) +@@ -595,7 +595,7 @@ s32 timekeeping_get_tai_offset(void) + static void __timekeeping_set_tai_offset(struct timekeeper *tk, s32 tai_offset) + { + tk->tai_offset = tai_offset; +- tk->offs_tai = ktime_sub(tk->offs_real, ktime_set(tai_offset, 0)); ++ tk->offs_tai = ktime_add(tk->offs_real, ktime_set(tai_offset, 0)); + } + + /**