From: pang.xunlei Date: Thu, 9 Oct 2014 07:04:31 +0000 (+0800) Subject: time: Complete NTP adjustment threshold judging conditions X-Git-Url: http://drtracing.org/?a=commitdiff_plain;h=659bc17b80c692e0ccda757e207fc4666d9b3e71;p=deliverable%2Flinux.git 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 [jstultz: Minor fix for > 80 char line] Signed-off-by: John Stultz --- 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) } if (unlikely(tk->tkr.clock->maxadj && - (tk->tkr.mult > tk->tkr.clock->mult + tk->tkr.clock->maxadj))) { + (abs(tk->tkr.mult - tk->tkr.clock->mult) + > tk->tkr.clock->maxadj))) { printk_once(KERN_WARNING "Adjusting %s more than 11%% (%ld vs %ld)\n", tk->tkr.clock->name, (long)tk->tkr.mult,