From patchwork Tue Jul 17 21:49:23 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: john stultz X-Patchwork-Id: 10084 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 DEF2723E3D for ; Tue, 17 Jul 2012 21:49:55 +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 AE03BA18224 for ; Tue, 17 Jul 2012 21:49:55 +0000 (UTC) Received: by mail-gh0-f180.google.com with SMTP id z12so1041205ghb.11 for ; Tue, 17 Jul 2012 14:49:55 -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=u2Ij5KMCP3u7cYPmB67VvuO+E4MOXwbhShtwAylrInQ=; b=XE5yoioAlexcdGd1MO8t4YpJrjR4ujvRVELW3P5Nchs9SOfZQdGRpDJYDlbfk4mlH3 ZGi1SdKkAx0en4YmQ6Qcq5tGtdZM0VFR4famwOFN4xtOA+mz9ctkQyA/1ek+hsBWcKlr 3P4S3Z90f8JV0RozGMCFVH4mPxROfo0WIQ7YQVAtAKmOHfJxQdWcFdIQyin0x6/sJCxA u8EUPStYgOM/3FfPXvsoO1xNxxLl7AmzxbyopD6nlCmQRR2+wHE/Prd9OVK8yII9GFiJ GSecNmOlYAG/g775oj/p0PV6xNAZXaPxCGRVXFI0jOI2QPKAK4uaggdUZTvHP+/SbyPo ykHQ== Received: by 10.50.195.234 with SMTP id ih10mr255909igc.0.1342561795384; Tue, 17 Jul 2012 14:49:55 -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 lc2csp24879ibb; Tue, 17 Jul 2012 14:49:54 -0700 (PDT) Received: by 10.182.12.74 with SMTP id w10mr5621127obb.54.1342561794531; Tue, 17 Jul 2012 14:49:54 -0700 (PDT) Received: from e33.co.us.ibm.com (e33.co.us.ibm.com. [32.97.110.151]) by mx.google.com with ESMTPS id m6si19444789oec.1.2012.07.17.14.49.54 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 17 Jul 2012 14:49:54 -0700 (PDT) Received-SPF: pass (google.com: domain of johnstul@us.ibm.com designates 32.97.110.151 as permitted sender) client-ip=32.97.110.151; Authentication-Results: mx.google.com; spf=pass (google.com: domain of johnstul@us.ibm.com designates 32.97.110.151 as permitted sender) smtp.mail=johnstul@us.ibm.com Received: from /spool/local by e33.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 17 Jul 2012 15:49:52 -0600 Received: from d03dlp03.boulder.ibm.com (9.17.202.179) by e33.co.us.ibm.com (192.168.1.133) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Tue, 17 Jul 2012 15:49:48 -0600 Received: from d03relay04.boulder.ibm.com (d03relay04.boulder.ibm.com [9.17.195.106]) by d03dlp03.boulder.ibm.com (Postfix) with ESMTP id 2ADAC19D804A; Tue, 17 Jul 2012 21:49:45 +0000 (WET) Received: from d03av05.boulder.ibm.com (d03av05.boulder.ibm.com [9.17.195.85]) by d03relay04.boulder.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q6HLnh3Z099740; Tue, 17 Jul 2012 15:49:43 -0600 Received: from d03av05.boulder.ibm.com (loopback [127.0.0.1]) by d03av05.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id q6HLncPJ026553; Tue, 17 Jul 2012 15:49:39 -0600 Received: from kernel.stglabs.ibm.com (kernel.stglabs.ibm.com [9.114.214.19]) by d03av05.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id q6HLnZI1026401; Tue, 17 Jul 2012 15:49:37 -0600 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] 2.6.34.x: timekeeping: Fix CLOCK_MONOTONIC inconsistency during leapsecond Date: Tue, 17 Jul 2012 17:49:23 -0400 Message-Id: <1342561771-55678-4-git-send-email-johnstul@us.ibm.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1342561771-55678-1-git-send-email-johnstul@us.ibm.com> References: <1342561771-55678-1-git-send-email-johnstul@us.ibm.com> X-Content-Scanned: Fidelis XPS MAILER x-cbid: 12071721-2398-0000-0000-000008945797 X-Gm-Message-State: ALoCoQlfVxr+cr/PPZng3zZGSZPPdzQEJHjOBlxxMoqxigUij84Q6tvA6k0LKq22OzkC8l1X4kzd 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 | 1 + 1 file changed, 1 insertion(+) diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c index df1e939..f8d4877 100644 --- a/kernel/time/timekeeping.c +++ b/kernel/time/timekeeping.c @@ -759,6 +759,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 into raw time */