| Submitter | John Stultz |
|---|---|
| Date | Aug. 21, 2012, 3:38 a.m. |
| Message ID | <5033029A.2030201@linaro.org> |
| Download | mbox | patch |
| Permalink | /patch/178949/ |
| State | Not Applicable |
| Headers | show |
Comments
John Stultz <john.stultz@linaro.org> writes: > @@ -115,6 +115,7 @@ static void tk_xtime_add(struct timekeeper *tk, const struct timespec *ts) > { > tk->xtime_sec += ts->tv_sec; > tk->xtime_nsec += (u64)ts->tv_nsec << tk->shift; > + tk_normalize_xtime(tk); > } Yes, that does it. Failure to normalize is always bad. Andreas.
On 08/21/2012 12:14 AM, Andreas Schwab wrote: > John Stultz <john.stultz@linaro.org> writes: > >> @@ -115,6 +115,7 @@ static void tk_xtime_add(struct timekeeper *tk, const struct timespec *ts) >> { >> tk->xtime_sec += ts->tv_sec; >> tk->xtime_nsec += (u64)ts->tv_nsec << tk->shift; >> + tk_normalize_xtime(tk); >> } > Yes, that does it. Failure to normalize is always bad. Great. Thanks for the testing and the bug report! I'll be sending out the patch to -tip later today. thanks -john
Patch
diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c index e16af19..1a9b9c5 100644 --- a/kernel/time/timekeeping.c +++ b/kernel/time/timekeeping.c @@ -115,6 +115,7 @@ static void tk_xtime_add(struct timekeeper *tk, const struct timespec *ts) { tk->xtime_sec += ts->tv_sec; tk->xtime_nsec += (u64)ts->tv_nsec << tk->shift; + tk_normalize_xtime(tk); } static void tk_set_wall_to_mono(struct timekeeper *tk, struct timespec wtm) @@ -695,9 +696,22 @@ static void __timekeeping_inject_sleeptime(struct timekeeper *tk, "sleep delta value!\n"); return; } + + printk("JDB: pre xt %ld:%ld wtm: %ld:%ld st: %ld:%ld\n", + tk_xtime(tk).tv_sec, tk_xtime(tk).tv_nsec, + tk->wall_to_monotonic.tv_sec,tk->wall_to_monotonic.tv_nsec, + tk->total_sleep_time.tv_sec, tk->total_sleep_time.tv_nsec); + printk("JDB: Adding %ld:%ld\n", delta->tv_sec, delta->tv_nsec); + tk_xtime_add(tk, delta); tk_set_wall_to_mono(tk, timespec_sub(tk->wall_to_monotonic, *delta)); tk_set_sleep_time(tk, timespec_add(tk->total_sleep_time, *delta)); + + printk("JDB: post xt %ld:%ld wtm: %ld:%ld st: %ld:%ld\n", + tk_xtime(tk).tv_sec, tk_xtime(tk).tv_nsec, + tk->wall_to_monotonic.tv_sec,tk->wall_to_monotonic.tv_nsec, + tk->total_sleep_time.tv_sec, tk->total_sleep_time.tv_nsec); + } /**