From patchwork Tue Jul 17 17:33:49 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: john stultz X-Patchwork-Id: 10052 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 9A28124036 for ; Tue, 17 Jul 2012 17:34:32 +0000 (UTC) Received: from mail-yx0-f180.google.com (mail-yx0-f180.google.com [209.85.213.180]) by fiordland.canonical.com (Postfix) with ESMTP id 2F8F8A18610 for ; Tue, 17 Jul 2012 17:34:29 +0000 (UTC) Received: by mail-yx0-f180.google.com with SMTP id q6so716284yen.11 for ; Tue, 17 Jul 2012 10:34:29 -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=bBup2ZabErc5s0Pg4bgPn5g6DanLJ36PAcA3uQJipFM=; b=MnEWbxviczWlD+tBxq2Nbq0HBg442rd8eCOJT0XsSSPssPHV9jIBgfWHKg/YS9bw4Q AoJulfjC9zkR+AK8EuSiUae3aT7VtOxS7LOBmVdnR6PB/luVXBL7yx7ExD95Ff0PaTbD XFfrU70O4ERMwjoxySKMefz1j3dlM8mBCYZkqIM+aaCJ7zEuZS/FMrEYGlfbcUqS5/yk uUWaqzX+CBm8/GjammB3oRSuKj/mCDFcw14IL6ds3cVzegUWZaAQpW+KmIiExX7nTIZ5 xwHdccR01yzyn/B9V0J1P5JgkRRTVWMcpBns/6bEWgTfoS049a0nFbsFiDd3c3whyi2D VsrQ== Received: by 10.50.203.39 with SMTP id kn7mr2108013igc.53.1342546468732; Tue, 17 Jul 2012 10:34:28 -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 lc2csp22512ibb; Tue, 17 Jul 2012 10:34:27 -0700 (PDT) Received: by 10.182.174.68 with SMTP id bq4mr4550895obc.53.1342546466555; Tue, 17 Jul 2012 10:34:26 -0700 (PDT) Received: from e39.co.us.ibm.com (e39.co.us.ibm.com. [32.97.110.160]) by mx.google.com with ESMTPS id jv10si18998201obb.97.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.160 as permitted sender) client-ip=32.97.110.160; Authentication-Results: mx.google.com; spf=pass (google.com: domain of johnstul@us.ibm.com designates 32.97.110.160 as permitted sender) smtp.mail=johnstul@us.ibm.com Received: from /spool/local by e39.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 17 Jul 2012 11:34:25 -0600 Received: from d03dlp03.boulder.ibm.com (9.17.202.179) by e39.co.us.ibm.com (192.168.1.139) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Tue, 17 Jul 2012 11:34:23 -0600 Received: from d03relay05.boulder.ibm.com (d03relay05.boulder.ibm.com [9.17.195.107]) by d03dlp03.boulder.ibm.com (Postfix) with ESMTP id C037319D804A; 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 q6HHYAKu166240; Tue, 17 Jul 2012 11:34:15 -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 q6HHZHUL016094; Tue, 17 Jul 2012 11:35:17 -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 q6HHZEE3015928; Tue, 17 Jul 2012 11:35:16 -0600 From: John Stultz To: stable@vger.kernel.org Cc: Richard Cochran , Prarit Bhargava , Thomas Gleixner , Linux Kernel , John Stultz Subject: [PATCH 02/11] 3.0.x: ntp: Correct TAI offset during leap second Date: Tue, 17 Jul 2012 13:33:49 -0400 Message-Id: <1342546438-17534-3-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-4242-0000-0000-0000025C34D5 X-Gm-Message-State: ALoCoQlfqCu+3bDJpfoD5ykOcGNOoKYmN/uaTDwuC8v+A6TanP2tm3PGrrirpgvpdXq5rYIxXfNu From: Richard Cochran This is a backport of dd48d708ff3e917f6d6b6c2b696c3f18c019feed When repeating a UTC time value during a leap second (when the UTC time should be 23:59:60), the TAI timescale should not stop. The kernel NTP code increments the TAI offset one second too late. This patch fixes the issue by incrementing the offset during the leap second itself. Signed-off-by: Richard Cochran Cc: Prarit Bhargava Cc: Thomas Gleixner Cc: Linux Kernel Signed-off-by: John Stultz --- kernel/time/ntp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/time/ntp.c b/kernel/time/ntp.c index 4508f7f..f1eb182 100644 --- a/kernel/time/ntp.c +++ b/kernel/time/ntp.c @@ -378,6 +378,7 @@ int second_overflow(unsigned long secs) if (secs % 86400 == 0) { leap = -1; time_state = TIME_OOP; + time_tai++; printk(KERN_NOTICE "Clock: inserting leap second 23:59:60 UTC\n"); } @@ -392,7 +393,6 @@ int second_overflow(unsigned long secs) } break; case TIME_OOP: - time_tai++; time_state = TIME_WAIT; break;