From patchwork Mon Aug 17 20:41:03 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Stultz X-Patchwork-Id: 52485 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f70.google.com (mail-la0-f70.google.com [209.85.215.70]) by patches.linaro.org (Postfix) with ESMTPS id 7D8B22156D for ; Mon, 17 Aug 2015 20:41:40 +0000 (UTC) Received: by lagz9 with SMTP id z9sf50802318lag.3 for ; Mon, 17 Aug 2015 13:41:39 -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:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=HiaVYTZMZJjHtVyWBYG+Sqgam/Qv0yXvxJkfuCjMRhg=; b=iKursUA9PLGgeFdgJ8/YJEvdW0X8rej+LUgaLrO4ZH7py0KmsLa1t14aIlKKd7pmWn gkpjJia8BU7Q2mrya7R4BnuzOVaJwSDRq/3gUpuIGIN3uDoOgq31HfxaGQ/GKlrELIxn xFnQATgzGENzYmWy1B3szc8dxGkd8LwM1oByK6hQwQ9EvJ+3+dbswVohdcMfFcsB+XYl s6WVd98dQ6IEKoNvOKJq8vRHcxv/wWoYI2/PY3ZbOTF9RsMJ8MXqMusi6d5QcDMk2G/r WYoFe4CWUNSHURJvz1lymFUsNbnNMbCFiLelGbHDM2rYNOq0KQGtVOogbYAC1f6i43LB HZDg== X-Gm-Message-State: ALoCoQkuHTkXWCFhmCYU28CmUAMjkORlLE7mJJScL82OAUcYs6D8jXgFoj8prRhFP4Jwhzm6rx0Z X-Received: by 10.112.227.105 with SMTP id rz9mr794978lbc.8.1439844099468; Mon, 17 Aug 2015 13:41:39 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.6.101 with SMTP id z5ls634475laz.65.gmail; Mon, 17 Aug 2015 13:41:39 -0700 (PDT) X-Received: by 10.152.206.75 with SMTP id lm11mr2618319lac.11.1439844099204; Mon, 17 Aug 2015 13:41:39 -0700 (PDT) Received: from mail-la0-f42.google.com (mail-la0-f42.google.com. [209.85.215.42]) by mx.google.com with ESMTPS id n4si12383358laj.18.2015.08.17.13.41.39 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 17 Aug 2015 13:41:39 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.42 as permitted sender) client-ip=209.85.215.42; Received: by lagz9 with SMTP id z9so86831538lag.3 for ; Mon, 17 Aug 2015 13:41:39 -0700 (PDT) X-Received: by 10.152.26.163 with SMTP id m3mr2623109lag.86.1439844098702; Mon, 17 Aug 2015 13:41:38 -0700 (PDT) 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.162.200 with SMTP id yc8csp86035lbb; Mon, 17 Aug 2015 13:41:37 -0700 (PDT) X-Received: by 10.68.200.72 with SMTP id jq8mr5952176pbc.91.1439844081252; Mon, 17 Aug 2015 13:41:21 -0700 (PDT) Received: from mail-pa0-f52.google.com (mail-pa0-f52.google.com. [209.85.220.52]) by mx.google.com with ESMTPS id iu3si26258813pbc.96.2015.08.17.13.41.20 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 17 Aug 2015 13:41:21 -0700 (PDT) Received-SPF: pass (google.com: domain of john.stultz@linaro.org designates 209.85.220.52 as permitted sender) client-ip=209.85.220.52; Received: by pabyb7 with SMTP id yb7so115757762pab.0 for ; Mon, 17 Aug 2015 13:41:20 -0700 (PDT) X-Received: by 10.68.215.97 with SMTP id oh1mr6069834pbc.67.1439844080345; Mon, 17 Aug 2015 13:41:20 -0700 (PDT) Received: from localhost.localdomain (c-76-115-103-22.hsd1.or.comcast.net. [76.115.103.22]) by smtp.gmail.com with ESMTPSA id gu2sm85199pbc.1.2015.08.17.13.41.19 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 17 Aug 2015 13:41:19 -0700 (PDT) From: John Stultz To: lkml Cc: Shaohua Li , Prarit Bhargava , Richard Cochran , Daniel Lezcano , Thomas Gleixner , Ingo Molnar , John Stultz Subject: [PATCH 9/9] clocksource: Sanity check watchdog clocksource Date: Mon, 17 Aug 2015 13:41:03 -0700 Message-Id: <1439844063-7957-10-git-send-email-john.stultz@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1439844063-7957-1-git-send-email-john.stultz@linaro.org> References: <1439844063-7957-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.215.42 as permitted sender) smtp.mailfrom=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: Shaohua Li Add a sanity check to make sure watchdog clocksource doesn't wrap too quickly. Cc: Prarit Bhargava Cc: Richard Cochran Cc: Daniel Lezcano Cc: Thomas Gleixner Cc: Ingo Molnar Signed-off-by: Shaohua Li Signed-off-by: John Stultz --- kernel/time/clocksource.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/kernel/time/clocksource.c b/kernel/time/clocksource.c index 8417c83..64e4629 100644 --- a/kernel/time/clocksource.c +++ b/kernel/time/clocksource.c @@ -327,7 +327,8 @@ static void clocksource_enqueue_watchdog(struct clocksource *cs) if (cs->flags & CLOCK_SOURCE_IS_CONTINUOUS) cs->flags |= CLOCK_SOURCE_VALID_FOR_HRES; /* Pick the best watchdog. */ - if (!watchdog || cs->rating > watchdog->rating) { + if (cs->max_idle_ns > WATCHDOG_MAX_INTERVAL_NS && + (!watchdog || cs->rating > watchdog->rating)) { watchdog = cs; /* Reset watchdog cycles */ clocksource_reset_watchdog();