From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751522AbbJBU6B (ORCPT ); Fri, 2 Oct 2015 16:58:01 -0400 Received: from terminus.zytor.com ([198.137.202.10]:51951 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751432AbbJBU55 (ORCPT ); Fri, 2 Oct 2015 16:57:57 -0400 Date: Fri, 2 Oct 2015 13:57:37 -0700 From: tip-bot for John Stultz Message-ID: Cc: linux-kernel@vger.kernel.org, mingo@kernel.org, john.stultz@linaro.org, prarit@redhat.com, richardcochran@gmail.com, tglx@linutronix.de, hpa@zytor.com Reply-To: mingo@kernel.org, linux-kernel@vger.kernel.org, john.stultz@linaro.org, prarit@redhat.com, richardcochran@gmail.com, tglx@linutronix.de, hpa@zytor.com In-Reply-To: <1442279124-7309-2-git-send-email-john.stultz@linaro.org> References: <1442279124-7309-2-git-send-email-john.stultz@linaro.org> To: linux-tip-commits@vger.kernel.org Subject: [tip:timers/urgent] clocksource: Fix abs() usage w/ 64bit values Git-Commit-ID: 67dfae0cd72fec5cd158b6e5fb1647b7dbe0834c X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 67dfae0cd72fec5cd158b6e5fb1647b7dbe0834c Gitweb: http://git.kernel.org/tip/67dfae0cd72fec5cd158b6e5fb1647b7dbe0834c Author: John Stultz AuthorDate: Mon, 14 Sep 2015 18:05:20 -0700 Committer: Thomas Gleixner CommitDate: Fri, 2 Oct 2015 22:53:01 +0200 clocksource: Fix abs() usage w/ 64bit values This patch fixes one cases where abs() was being used with 64-bit nanosecond values, where the result may be capped at 32-bits. This potentially could cause watchdog false negatives on 32-bit systems, so this patch addresses the issue by using abs64(). Signed-off-by: John Stultz Cc: Prarit Bhargava Cc: Richard Cochran Cc: Ingo Molnar Cc: stable@vger.kernel.org Link: http://lkml.kernel.org/r/1442279124-7309-2-git-send-email-john.stultz@linaro.org Signed-off-by: Thomas Gleixner --- kernel/time/clocksource.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/time/clocksource.c b/kernel/time/clocksource.c index 841b72f..3a38775 100644 --- a/kernel/time/clocksource.c +++ b/kernel/time/clocksource.c @@ -217,7 +217,7 @@ static void clocksource_watchdog(unsigned long data) continue; /* Check the deviation from the watchdog clocksource. */ - if ((abs(cs_nsec - wd_nsec) > WATCHDOG_THRESHOLD)) { + if (abs64(cs_nsec - wd_nsec) > WATCHDOG_THRESHOLD) { pr_warn("timekeeping watchdog: Marking clocksource '%s' as unstable because the skew is too large:\n", cs->name); pr_warn(" '%s' wd_now: %llx wd_last: %llx mask: %llx\n",