Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933483AbbKMABi (ORCPT ); Thu, 12 Nov 2015 19:01:38 -0500 Received: from youngberry.canonical.com ([91.189.89.112]:45045 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754541AbbKLXTC (ORCPT ); Thu, 12 Nov 2015 18:19:02 -0500 From: Kamal Mostafa To: linux-kernel@vger.kernel.org, stable@vger.kernel.org, kernel-team@lists.ubuntu.com Cc: John Stultz , Prarit Bhargava , Richard Cochran , Ingo Molnar , Thomas Gleixner , Kamal Mostafa Subject: [PATCH 3.19.y-ckt 033/155] clocksource: Fix abs() usage w/ 64bit values Date: Thu, 12 Nov 2015 15:16:27 -0800 Message-Id: <1447370309-357-34-git-send-email-kamal@canonical.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1447370309-357-1-git-send-email-kamal@canonical.com> References: <1447370309-357-1-git-send-email-kamal@canonical.com> X-Extended-Stable: 3.19 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1661 Lines: 46 3.19.8-ckt10 -stable review patch. If anyone has any objections, please let me know. ------------------ From: John Stultz commit 67dfae0cd72fec5cd158b6e5fb1647b7dbe0834c upstream. 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 Link: http://lkml.kernel.org/r/1442279124-7309-2-git-send-email-john.stultz@linaro.org Signed-off-by: Thomas Gleixner Signed-off-by: Kamal Mostafa --- 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 b79f39b..de800df 100644 --- a/kernel/time/clocksource.c +++ b/kernel/time/clocksource.c @@ -296,7 +296,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) { clocksource_unstable(cs, cs_nsec - wd_nsec); continue; } -- 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/