Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751872AbbHQUlo (ORCPT ); Mon, 17 Aug 2015 16:41:44 -0400 Received: from mail-pa0-f48.google.com ([209.85.220.48]:34954 "EHLO mail-pa0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750906AbbHQUlU (ORCPT ); Mon, 17 Aug 2015 16:41:20 -0400 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> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1376 Lines: 38 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(); -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/