From patchwork Thu Oct 9 07:04:31 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "pang.xunlei" X-Patchwork-Id: 38496 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f197.google.com (mail-wi0-f197.google.com [209.85.212.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 72DE82032C for ; Thu, 9 Oct 2014 07:10:46 +0000 (UTC) Received: by mail-wi0-f197.google.com with SMTP id n3sf473762wiv.0 for ; Thu, 09 Oct 2014 00:10:45 -0700 (PDT) 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:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=JdnhlOW9Ne6HwyWU8JleWLt5FK9JRwr9yfiMFS/mP3g=; b=J8EMvzGyAaamTtzQXpHt4KBMXKAynReeBWxToT61W2BFOsGq52deiGoLeWxLiqJKRU ohW3UJfU5A5roLZvIzpD36tBVeU0dGK0mnGmSYaVQXuAf0Q7G8CEqu594UoDoUkOL9Gy GCprLgThw/VOT3sFtFCCffrcRjMMCWiLER+KZ3XiIu3lluN6Z97H96jtOi2HapoS0ruu AzXIhE9dTmCo7tG8VctuxZ6o5RjF6213NVcuN6LNtIG8WQzWdeYOFVdCSEzy0rcVcbdG 9igTKfVDRdVWgaRdfhFkoF4ErcTcmGOS2qMD5bp/Gq9A+fZ9UFao916pj5fOSm5oqmb0 gYKw== X-Gm-Message-State: ALoCoQkVZ1jI3dRULTzyHLPtX21L7uvo+v8Xfv0sjfWRstxSe6fNDg3sj+f/YaDFMd9BiYi5qmxX X-Received: by 10.180.188.145 with SMTP id ga17mr417445wic.3.1412838645670; Thu, 09 Oct 2014 00:10:45 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.22.37 with SMTP id a5ls139015laf.42.gmail; Thu, 09 Oct 2014 00:10:45 -0700 (PDT) X-Received: by 10.152.202.135 with SMTP id ki7mr16473835lac.16.1412838645043; Thu, 09 Oct 2014 00:10:45 -0700 (PDT) Received: from mail-lb0-f180.google.com (mail-lb0-f180.google.com [209.85.217.180]) by mx.google.com with ESMTPS id um10si2924090lbb.117.2014.10.09.00.10.44 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 09 Oct 2014 00:10:44 -0700 (PDT) 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 n15so564720lbi.11 for ; Thu, 09 Oct 2014 00:10:44 -0700 (PDT) X-Received: by 10.152.26.226 with SMTP id o2mr1821769lag.44.1412838644584; Thu, 09 Oct 2014 00:10:44 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.84.229 with SMTP id c5csp193263lbz; Thu, 9 Oct 2014 00:10:43 -0700 (PDT) X-Received: by 10.182.210.195 with SMTP id mw3mr10802764obc.82.1412838643337; Thu, 09 Oct 2014 00:10:43 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id th2si1767013obc.54.2014.10.09.00.10.42 for ; Thu, 09 Oct 2014 00:10:43 -0700 (PDT) Received-SPF: none (google.com: linux-kernel-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751334AbaJIHKb (ORCPT + 27 others); Thu, 9 Oct 2014 03:10:31 -0400 Received: from mail-ig0-f179.google.com ([209.85.213.179]:45796 "EHLO mail-ig0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750815AbaJIHKW (ORCPT ); Thu, 9 Oct 2014 03:10:22 -0400 Received: by mail-ig0-f179.google.com with SMTP id h18so2477268igc.12 for ; Thu, 09 Oct 2014 00:10:22 -0700 (PDT) X-Received: by 10.50.72.43 with SMTP id a11mr5943209igv.23.1412838621938; Thu, 09 Oct 2014 00:10:21 -0700 (PDT) Received: from wangdeqiang.com.cn ([210.21.227.66]) by mx.google.com with ESMTPSA id gb12sm4564577igd.0.2014.10.09.00.10.17 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 09 Oct 2014 00:10:21 -0700 (PDT) From: "pang.xunlei" To: linux-kernel@vger.kernel.org Cc: John Stultz , Thomas Gleixner , "pang.xunlei" Subject: [PATCH 2/2] time: Complete NTP adjustment threshold judging conditions Date: Thu, 9 Oct 2014 15:04:31 +0800 Message-Id: <1412838271-11175-2-git-send-email-pang.xunlei@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1412838271-11175-1-git-send-email-pang.xunlei@linaro.org> References: <1412838271-11175-1-git-send-email-pang.xunlei@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: pang.xunlei@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 Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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 --- kernel/time/timekeeping.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c index cad61b3..469cdbf 100644 --- a/kernel/time/timekeeping.c +++ b/kernel/time/timekeeping.c @@ -1403,7 +1403,7 @@ 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,