Skip to content

Commit fef76ea

Browse files
johnstultz-workgregkh
authored andcommitted
hrtimer: Fix incorrect tai offset calculation for non high-res timer systems
commit 2d926c1 upstream. I noticed some CLOCK_TAI timer test failures on one of my less-frequently used configurations. And after digging in I found in 76f4108 (Cleanup hrtimer accessors to the timekepeing state), the hrtimer_get_softirq_time tai offset calucation was incorrectly rewritten, as the tai offset we return shold be from CLOCK_MONOTONIC, and not CLOCK_REALTIME. This results in CLOCK_TAI timers expiring early on non-highres capable machines. This patch fixes the issue, calculating the tai time properly from the monotonic base. Signed-off-by: John Stultz <john.stultz@linaro.org> Cc: Thomas Gleixner <tglx@linutronix.de> Link: http://lkml.kernel.org/r/1423097126-10236-1-git-send-email-john.stultz@linaro.org Signed-off-by: Ingo Molnar <mingo@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 1c3a363 commit fef76ea

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎kernel/time/hrtimer.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ static void hrtimer_get_softirq_time(struct hrtimer_cpu_base *base)
122122
mono = ktime_get_update_offsets_tick(&off_real, &off_boot, &off_tai);
123123
boot = ktime_add(mono, off_boot);
124124
xtim = ktime_add(mono, off_real);
125-
tai = ktime_add(xtim, off_tai);
125+
tai = ktime_add(mono, off_tai);
126126

127127
base->clock_base[HRTIMER_BASE_REALTIME].softirq_time = xtim;
128128
base->clock_base[HRTIMER_BASE_MONOTONIC].softirq_time = mono;

0 commit comments

Comments
 (0)