From patchwork Fri Nov 21 19:44:09 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Stultz X-Patchwork-Id: 41355 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f69.google.com (mail-la0-f69.google.com [209.85.215.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 22DEE2452C for ; Fri, 21 Nov 2014 19:44:41 +0000 (UTC) Received: by mail-la0-f69.google.com with SMTP id gd6sf3516168lab.0 for ; Fri, 21 Nov 2014 11:44:40 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=V/ne4W6kf5fApgF1FAnzKGFQrp2x5MccASFprKx9I+s=; b=bqNfhJr8J7ZRcRsHGqLX66Fvtmr5kDhGNEegOZLrK0Jpc4RQQIqf3mniJ8/rKY2Tbi 66cmpRuBpj9QMCbjgneyL9+rFVugSIv2dtjjL2hKgWbNWnb6F0vZmEsMHlEWMNmXvlRw 7VELsOein4R38bKmVsn2C6NxwHDSKw6NsouxZCKLqSQBOdFNkWierq06oW30O2soOii4 6QLGlNTHIg40Bm21oP9MUHd4W4L73QJzmCjNeAl77LFIE99s5LrO6/AbkRoKeTbeJplZ SEHCOJVilMGnszcItW/zdnnJOtnFxrrMqUqZdD/vpu3bS2unxpvVpHN2hpefwuTD4h5u EUgA== X-Gm-Message-State: ALoCoQmgNQeI8+40X3O4bGL/A7i631qHZZAirIUygRFe/t8R7JS6NK5ENgN2JbQk8ECdKAqW9gWz X-Received: by 10.180.101.170 with SMTP id fh10mr11854603wib.4.1416599080060; Fri, 21 Nov 2014 11:44:40 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.28.193 with SMTP id d1ls226512lah.85.gmail; Fri, 21 Nov 2014 11:44:39 -0800 (PST) X-Received: by 10.112.138.137 with SMTP id qq9mr7262975lbb.80.1416599079905; Fri, 21 Nov 2014 11:44:39 -0800 (PST) Received: from mail-lb0-f180.google.com (mail-lb0-f180.google.com. [209.85.217.180]) by mx.google.com with ESMTPS id y1si7082421laa.37.2014.11.21.11.44.39 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 21 Nov 2014 11:44:39 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.180 as permitted sender) client-ip=209.85.217.180; Received: by mail-lb0-f180.google.com with SMTP id z11so4696183lbi.11 for ; Fri, 21 Nov 2014 11:44:39 -0800 (PST) X-Received: by 10.153.7.170 with SMTP id dd10mr7294371lad.44.1416599079822; Fri, 21 Nov 2014 11:44:39 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.112.184.201 with SMTP id ew9csp153711lbc; Fri, 21 Nov 2014 11:44:39 -0800 (PST) X-Received: by 10.66.163.129 with SMTP id yi1mr9918569pab.149.1416599077565; Fri, 21 Nov 2014 11:44:37 -0800 (PST) Received: from mail-pd0-f174.google.com (mail-pd0-f174.google.com. [209.85.192.174]) by mx.google.com with ESMTPS id tl10si10539270pac.46.2014.11.21.11.44.36 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 21 Nov 2014 11:44:37 -0800 (PST) Received-SPF: pass (google.com: domain of john.stultz@linaro.org designates 209.85.192.174 as permitted sender) client-ip=209.85.192.174; Received: by mail-pd0-f174.google.com with SMTP id w10so5849821pde.5 for ; Fri, 21 Nov 2014 11:44:36 -0800 (PST) X-Received: by 10.66.66.135 with SMTP id f7mr9964489pat.81.1416599076849; Fri, 21 Nov 2014 11:44:36 -0800 (PST) Received: from localhost.localdomain (c-67-170-153-23.hsd1.or.comcast.net. [67.170.153.23]) by mx.google.com with ESMTPSA id t9sm5513621pbs.75.2014.11.21.11.44.35 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 21 Nov 2014 11:44:36 -0800 (PST) From: John Stultz To: lkml Cc: "pang.xunlei" , Thomas Gleixner , Ingo Molnar , Arnd Bergmann , Miroslav Lichvar , Richard Cochran , Prarit Bhargava , Alessandro Zummo , John Stultz Subject: [PATCH 03/12] time: Complete NTP adjustment threshold judging conditions Date: Fri, 21 Nov 2014 11:44:09 -0800 Message-Id: <1416599058-13836-4-git-send-email-john.stultz@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1416599058-13836-1-git-send-email-john.stultz@linaro.org> References: <1416599058-13836-1-git-send-email-john.stultz@linaro.org> X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: john.stultz@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.180 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , From: "pang.xunlei" 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. Cc: Thomas Gleixner Cc: Ingo Molnar Cc: Arnd Bergmann Cc: pang.xunlei Cc: Miroslav Lichvar Cc: Richard Cochran Cc: Prarit Bhargava Cc: Alessandro Zummo Signed-off-by: pang.xunlei [jstultz: Minor fix for > 80 char line] Signed-off-by: John Stultz --- kernel/time/timekeeping.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c index cad61b3..41fcbe1 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,