diff options
author | pang.xunlei <pang.xunlei@linaro.org> | 2014-10-09 03:04:31 -0400 |
---|---|---|
committer | John Stultz <john.stultz@linaro.org> | 2014-11-21 14:59:56 -0500 |
commit | 659bc17b80c692e0ccda757e207fc4666d9b3e71 (patch) | |
tree | fa3862991f0e8490b3b20e862a3d16721daa786e /kernel/time | |
parent | 6067dc5a8c2b1b57e67eaf1125db1d63c1ed6361 (diff) |
time: Complete NTP adjustment threshold judging conditions
The clocksource mult-adjustment threshold is [mult-maxadj, mult+maxadj],
timekeeping_adjust() only deals with the upper threshold, but misses the
lower threshold.
This patch adds the lower threshold judging condition.
Signed-off-by: pang.xunlei <pang.xunlei@linaro.org>
[jstultz: Minor fix for > 80 char line]
Signed-off-by: John Stultz <john.stultz@linaro.org>
Diffstat (limited to 'kernel/time')
-rw-r--r-- | kernel/time/timekeeping.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c index cad61b3f6bea..41fcbe19ccfe 100644 --- a/kernel/time/timekeeping.c +++ b/kernel/time/timekeeping.c | |||
@@ -1403,7 +1403,8 @@ static void timekeeping_adjust(struct timekeeper *tk, s64 offset) | |||
1403 | } | 1403 | } |
1404 | 1404 | ||
1405 | if (unlikely(tk->tkr.clock->maxadj && | 1405 | if (unlikely(tk->tkr.clock->maxadj && |
1406 | (tk->tkr.mult > tk->tkr.clock->mult + tk->tkr.clock->maxadj))) { | 1406 | (abs(tk->tkr.mult - tk->tkr.clock->mult) |
1407 | > tk->tkr.clock->maxadj))) { | ||
1407 | printk_once(KERN_WARNING | 1408 | printk_once(KERN_WARNING |
1408 | "Adjusting %s more than 11%% (%ld vs %ld)\n", | 1409 | "Adjusting %s more than 11%% (%ld vs %ld)\n", |
1409 | tk->tkr.clock->name, (long)tk->tkr.mult, | 1410 | tk->tkr.clock->name, (long)tk->tkr.mult, |