From patchwork Tue Jul 17 18:05:34 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: john stultz X-Patchwork-Id: 10069 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 BC5B023E2F for ; Tue, 17 Jul 2012 18:10:35 +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 84EA2A184CE for ; Tue, 17 Jul 2012 18:10:35 +0000 (UTC) Received: by ghbz12 with SMTP id z12so762111ghb.11 for ; Tue, 17 Jul 2012 11:10:35 -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=GpI3G+oaFYyUY0L6b5S/UustpU9nW8zA3548U2aEflE=; b=iuvgmCp36+KXa+wotK23+wW2rlBsoYj/a5uk50qoz1knCo9uUZmu+/dEYLA2DJ8BmZ rCc5ytP1/7BJ9z2fF3XtLnAo8mjh2rdneKk6aET/DEisugy+6CarA8K83mV/qt6lGX5b I24SrseYFIbcBKHl+izELY2cl0SFdVHGGyNMR8SPsqEYWdmAPsE9RwpZU0KzuB7fwm+E XzVF806Gj7tnTL4ZRv4Eq+msAd84mkuTzg6fxf4Otmi7AF80Gj1OY+k31TYmRdHMLCda o5RkpoAKggd/OfCZT9Na0NcZR+SafB5o252wYSzclKUaPj16QeFeRqkwsVD+h2HjZAZo oIZg== Received: by 10.50.87.227 with SMTP id bb3mr2182730igb.57.1342548634823; Tue, 17 Jul 2012 11:10:34 -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 lc2csp22982ibb; Tue, 17 Jul 2012 11:10:34 -0700 (PDT) Received: by 10.50.6.230 with SMTP id e6mr2238549iga.47.1342548634421; Tue, 17 Jul 2012 11:10:34 -0700 (PDT) Received: from e6.ny.us.ibm.com (e6.ny.us.ibm.com. [32.97.182.146]) by mx.google.com with ESMTPS id wo10si12715312igc.71.2012.07.17.11.10.34 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 17 Jul 2012 11:10:34 -0700 (PDT) Received-SPF: pass (google.com: domain of johnstul@us.ibm.com designates 32.97.182.146 as permitted sender) client-ip=32.97.182.146; Authentication-Results: mx.google.com; spf=pass (google.com: domain of johnstul@us.ibm.com designates 32.97.182.146 as permitted sender) smtp.mail=johnstul@us.ibm.com Received: from /spool/local by e6.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 17 Jul 2012 14:10:31 -0400 Received: from d01dlp03.pok.ibm.com (9.56.224.17) by e6.ny.us.ibm.com (192.168.1.106) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Tue, 17 Jul 2012 14:06:27 -0400 Received: from d01relay03.pok.ibm.com (d01relay03.pok.ibm.com [9.56.227.235]) by d01dlp03.pok.ibm.com (Postfix) with ESMTP id 18B44C90089; Tue, 17 Jul 2012 14:06:17 -0400 (EDT) Received: from d03av04.boulder.ibm.com (d03av04.boulder.ibm.com [9.17.195.170]) by d01relay03.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q6HI6GxL343238; Tue, 17 Jul 2012 14:06:16 -0400 Received: from d03av04.boulder.ibm.com (loopback [127.0.0.1]) by d03av04.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id q6HI65U2019221; Tue, 17 Jul 2012 12:06:06 -0600 Received: from kernel.stglabs.ibm.com (kernel.stglabs.ibm.com [9.114.214.19]) by d03av04.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id q6HI60xh018372; Tue, 17 Jul 2012 12:06:03 -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.35.x: timekeeping: Fix CLOCK_MONOTONIC inconsistency during leapsecond Date: Tue, 17 Jul 2012 14:05:34 -0400 Message-Id: <1342548342-19683-4-git-send-email-johnstul@us.ibm.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1342548342-19683-1-git-send-email-johnstul@us.ibm.com> References: <1342548342-19683-1-git-send-email-johnstul@us.ibm.com> X-Content-Scanned: Fidelis XPS MAILER x-cbid: 12071718-1976-0000-0000-00000F443426 X-Gm-Message-State: ALoCoQmbCEtkcbpwmZYzpokTndFyiGxp2Py0oMdE9negPkz5AZjazfKnhK60I+Vkohz5y+qk0QxW 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 8c4b32e..5960728 100644 --- a/kernel/time/timekeeping.c +++ b/kernel/time/timekeeping.c @@ -750,6 +750,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 */ @@ -859,7 +860,7 @@ 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 */