From patchwork Tue Jul 17 07:05:16 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: john stultz X-Patchwork-Id: 10037 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 80CDA23E1B for ; Tue, 17 Jul 2012 07:06:31 +0000 (UTC) Received: from mail-gh0-f180.google.com (mail-gh0-f180.google.com [209.85.160.180]) by fiordland.canonical.com (Postfix) with ESMTP id 51398A185E8 for ; Tue, 17 Jul 2012 07:06:31 +0000 (UTC) Received: by mail-gh0-f180.google.com with SMTP id z12so65734ghb.11 for ; Tue, 17 Jul 2012 00:06:31 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:from:to:cc :subject:date:message-id:x-mailer:in-reply-to:references :x-content-scanned:x-cbid:x-gm-message-state; bh=zV8ZKAuNRPNUg9X5hJ5tlN6qZ0zTSKrccEdXhb9oaGs=; b=TlnHfv2CEeM3hKKmwybVJ9sjgvor7HrSeTXKAFnBfzInoTvlkz1HBzcMNbXR1E0zm3 91bAtz2zylJz+IqTsP487Ozfdag8+K8qBwHzmPSS6ZUzEPNV1Ts5ofRjIOLB8lne8PKd a/ogvsJjNWzoz27xJVFdVleNkbF1KqWmp8vodwMoOQb8DlqRxsYHGSaCLKDw6kRKbV7b 8dqy7G3++rV57Cm6GGRc3E/NWm/Gq8B27WtZxCarD9E50rhHB+ZGql3PnyBu1EnEElXH MqgYKgqtVY7c7CvWuLfbgg8rsiwKmvjACWxsEVdWoQMAXCflPZjmrAVhE5azoPlVYlR/ XbYw== Received: by 10.50.195.234 with SMTP id ih10mr504474igc.0.1342508790921; Tue, 17 Jul 2012 00:06:30 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.231.241.2 with SMTP id lc2csp15919ibb; Tue, 17 Jul 2012 00:06:30 -0700 (PDT) Received: by 10.42.154.69 with SMTP id p5mr705996icw.4.1342508790543; Tue, 17 Jul 2012 00:06:30 -0700 (PDT) Received: from e5.ny.us.ibm.com (e5.ny.us.ibm.com. [32.97.182.145]) by mx.google.com with ESMTPS id l10si23607998icz.103.2012.07.17.00.06.30 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 17 Jul 2012 00:06:30 -0700 (PDT) Received-SPF: pass (google.com: domain of johnstul@us.ibm.com designates 32.97.182.145 as permitted sender) client-ip=32.97.182.145; Authentication-Results: mx.google.com; spf=pass (google.com: domain of johnstul@us.ibm.com designates 32.97.182.145 as permitted sender) smtp.mail=johnstul@us.ibm.com Received: from /spool/local by e5.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 17 Jul 2012 03:06:28 -0400 Received: from d01dlp01.pok.ibm.com (9.56.224.56) by e5.ny.us.ibm.com (192.168.1.105) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Tue, 17 Jul 2012 03:05:40 -0400 Received: from d01relay05.pok.ibm.com (d01relay05.pok.ibm.com [9.56.227.237]) by d01dlp01.pok.ibm.com (Postfix) with ESMTP id 7438438C803A; Tue, 17 Jul 2012 03:05:39 -0400 (EDT) Received: from d01av04.pok.ibm.com (d01av04.pok.ibm.com [9.56.224.64]) by d01relay05.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q6H75dAw069792; Tue, 17 Jul 2012 03:05:39 -0400 Received: from d01av04.pok.ibm.com (loopback [127.0.0.1]) by d01av04.pok.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id q6H75bv1016130; Tue, 17 Jul 2012 03:05:38 -0400 Received: from kernel.stglabs.ibm.com (kernel.stglabs.ibm.com [9.114.214.19]) by d01av04.pok.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id q6H75aBL015997; Tue, 17 Jul 2012 03:05:37 -0400 From: John Stultz To: stable@vger.kernel.org Cc: John Stultz , stable@kernel.org, Thomas Gleixner , Prarit Bhargava , Linux Kernel , John Stultz Subject: [PATCH 03/11] 3.2.x: timekeeping: Fix CLOCK_MONOTONIC inconsistency during leapsecond Date: Tue, 17 Jul 2012 03:05:16 -0400 Message-Id: <1342508724-14527-4-git-send-email-johnstul@us.ibm.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1342508724-14527-1-git-send-email-johnstul@us.ibm.com> References: <1342508724-14527-1-git-send-email-johnstul@us.ibm.com> X-Content-Scanned: Fidelis XPS MAILER x-cbid: 12071707-5930-0000-0000-000009EE3DE3 X-Gm-Message-State: ALoCoQleTsakYMlpgnzVkC/tsp7qu9Ds9XeAbVnb9CALtRIsYv8eFvOREUdTki7hMspAU5Rav5Og From: John Stultz This is a backport of fad0c66c4bb836d57a5f125ecd38bed653ca863a which resolves a bug the previous commit. Commit 6b43ae8a61 (ntp: Fix leap-second hrtimer livelock) broke the leapsecond update of CLOCK_MONOTONIC. The missing leapsecond update to wall_to_monotonic causes discontinuities in CLOCK_MONOTONIC. Adjust wall_to_monotonic when NTP inserted a leapsecond. Reported-by: Richard Cochran Signed-off-by: John Stultz Tested-by: Richard Cochran Cc: stable@kernel.org Link: http://lkml.kernel.org/r/1338400497-12420-1-git-send-email-john.stultz@linaro.org Signed-off-by: Thomas Gleixner Cc: Prarit Bhargava Cc: Thomas Gleixner Cc: Linux Kernel Signed-off-by: John Stultz --- kernel/time/timekeeping.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c index 4780a7d..5c9b67e 100644 --- a/kernel/time/timekeeping.c +++ b/kernel/time/timekeeping.c @@ -938,6 +938,7 @@ static cycle_t logarithmic_accumulation(cycle_t offset, int shift) xtime.tv_sec++; leap = second_overflow(xtime.tv_sec); xtime.tv_sec += leap; + wall_to_monotonic.tv_sec -= leap; } /* Accumulate raw time */ @@ -1048,7 +1049,7 @@ static void update_wall_time(void) xtime.tv_sec++; leap = second_overflow(xtime.tv_sec); xtime.tv_sec += leap; - + wall_to_monotonic.tv_sec -= leap; } /* check to see if there is a new clocksource to use */