From patchwork Tue Jul 17 17:33:50 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: john stultz X-Patchwork-Id: 10050 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 C9A8624027 for ; Tue, 17 Jul 2012 17:34:29 +0000 (UTC) Received: from mail-gg0-f180.google.com (mail-gg0-f180.google.com [209.85.161.180]) by fiordland.canonical.com (Postfix) with ESMTP id BD3ACA182FF for ; Tue, 17 Jul 2012 17:34:28 +0000 (UTC) Received: by ggnf1 with SMTP id f1so713432ggn.11 for ; Tue, 17 Jul 2012 10:34:28 -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=bQ+z5vud0buJW+35ZyMD2aujQOq/Hq9sYCVwcvE43eQ=; b=PAefv2cQgnVa+VzwHeH//ibMtGS6M/ipm6R8+KJRXqUJqFneBTJLpSZ9/P4yczA7oY vETIfBR+2cuYiOxdTjjtbzCro1SHhzV2mjDhJUZqlDxx2c+RaCj8snliIAUSSU4D+KCv WiRJ0Z3rLnRgtyFwqLr9RtfCVqt6xA40op3Tpao/3A9ESMvTxyZcXu/G8liv+XGrM8pP h1Pjemvh2CuHlTsKKZ4OhOZrfnC6n2t0bx8dBL+f55LCtWgASxYyOQpzLxwwplkfSVpu 3zRuiOdnbJ/XdlG7xG9qAYUJP7hxCzGGsRyabJ6GejnSH4QqnxFtdJOYZQoS3vuH5grm z+FQ== Received: by 10.50.40.193 with SMTP id z1mr2222935igk.0.1342546467884; Tue, 17 Jul 2012 10:34:27 -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 lc2csp22513ibb; Tue, 17 Jul 2012 10:34:27 -0700 (PDT) Received: by 10.50.100.137 with SMTP id ey9mr2113150igb.61.1342546466795; Tue, 17 Jul 2012 10:34:26 -0700 (PDT) Received: from e36.co.us.ibm.com (e36.co.us.ibm.com. [32.97.110.154]) by mx.google.com with ESMTPS id ml5si17492134igc.40.2012.07.17.10.34.26 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 17 Jul 2012 10:34:26 -0700 (PDT) Received-SPF: pass (google.com: domain of johnstul@us.ibm.com designates 32.97.110.154 as permitted sender) client-ip=32.97.110.154; Authentication-Results: mx.google.com; spf=pass (google.com: domain of johnstul@us.ibm.com designates 32.97.110.154 as permitted sender) smtp.mail=johnstul@us.ibm.com Received: from /spool/local by e36.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 17 Jul 2012 11:34:24 -0600 Received: from d03dlp01.boulder.ibm.com (9.17.202.177) by e36.co.us.ibm.com (192.168.1.136) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Tue, 17 Jul 2012 11:34:22 -0600 Received: from d03relay05.boulder.ibm.com (d03relay05.boulder.ibm.com [9.17.195.107]) by d03dlp01.boulder.ibm.com (Postfix) with ESMTP id BA21EC40004; Tue, 17 Jul 2012 17:34:20 +0000 (WET) Received: from d03av06.boulder.ibm.com (d03av06.boulder.ibm.com [9.17.195.245]) by d03relay05.boulder.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q6HHYDAQ041986; Tue, 17 Jul 2012 11:34:16 -0600 Received: from d03av06.boulder.ibm.com (loopback [127.0.0.1]) by d03av06.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id q6HHZIoH016141; Tue, 17 Jul 2012 11:35:18 -0600 Received: from kernel.stglabs.ibm.com (kernel.stglabs.ibm.com [9.114.214.19]) by d03av06.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id q6HHZEE4015928; Tue, 17 Jul 2012 11:35:17 -0600 From: John Stultz To: stable@vger.kernel.org Cc: John Stultz , Thomas Gleixner , Prarit Bhargava , Linux Kernel , John Stultz Subject: [PATCH 03/11] 3.0.x: timekeeping: Fix CLOCK_MONOTONIC inconsistency during leapsecond Date: Tue, 17 Jul 2012 13:33:50 -0400 Message-Id: <1342546438-17534-4-git-send-email-johnstul@us.ibm.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1342546438-17534-1-git-send-email-johnstul@us.ibm.com> References: <1342546438-17534-1-git-send-email-johnstul@us.ibm.com> X-Content-Scanned: Fidelis XPS MAILER x-cbid: 12071717-7606-0000-0000-000002132724 X-Gm-Message-State: ALoCoQkE4Wdt/37Y8u8wjyJG/NMzDSo8ehci9/RQvCbXr419F/EIFKJj+yKVbjtORTWDNknDV0ZT 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 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 c444da0..ac5b225 100644 --- a/kernel/time/timekeeping.c +++ b/kernel/time/timekeeping.c @@ -824,6 +824,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 */ @@ -934,7 +935,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 */