From patchwork Tue Jul 17 18:05:33 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: john stultz X-Patchwork-Id: 10068 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 77A5E23E2F for ; Tue, 17 Jul 2012 18:07:47 +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 48BDEA184CE for ; Tue, 17 Jul 2012 18:07:47 +0000 (UTC) Received: by yenq6 with SMTP id q6so761403yen.11 for ; Tue, 17 Jul 2012 11:07:46 -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=oi4BPn5YnFUii6Xk1KwHsl6avjaD4/vXZBCIwXAiYis=; b=dGQOSjhOYpyFYIMwM4CnPM7Bd9YJzUSbP4wwcJ8ikNWrWRdgLtREvtTO9S6Vi9/ACR dDMIKPSLpDN3bwZnW21aWTCtsxDUYRDhrqsrtSW5x+lpmD1xc7c/IQzeoBpPGCdvN9WY PNX1iOhVZWN1Xx13FBAeEPZeVflAfHyIX/mLgNQ6YBHq3mF8sEqJbLxJ6CrcZ/VMKaKa fqDM70xq5ww5XLtsrW3AFqmurYFYn9yEy/4oJOLTfRnr1kGy784WnzurFjReTClLZQfh vNG0K5CYDmKfvcrUTMqDxrCVnuKtNu8Ecqc8LRc3HI7u043wcTbBmmTvDjJV1IWWY8uA CbCg== Received: by 10.50.203.39 with SMTP id kn7mr2179391igc.53.1342548466497; Tue, 17 Jul 2012 11:07:46 -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 lc2csp22959ibb; Tue, 17 Jul 2012 11:07:46 -0700 (PDT) Received: by 10.60.21.198 with SMTP id x6mr4722630oee.24.1342548466013; Tue, 17 Jul 2012 11:07:46 -0700 (PDT) Received: from e37.co.us.ibm.com (e37.co.us.ibm.com. [32.97.110.158]) by mx.google.com with ESMTPS id e8si18833541oee.0.2012.07.17.11.07.45 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 17 Jul 2012 11:07:46 -0700 (PDT) Received-SPF: pass (google.com: domain of johnstul@us.ibm.com designates 32.97.110.158 as permitted sender) client-ip=32.97.110.158; Authentication-Results: mx.google.com; spf=pass (google.com: domain of johnstul@us.ibm.com designates 32.97.110.158 as permitted sender) smtp.mail=johnstul@us.ibm.com Received: from /spool/local by e37.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 17 Jul 2012 12:07:42 -0600 Received: from d03dlp02.boulder.ibm.com (9.17.202.178) by e37.co.us.ibm.com (192.168.1.137) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Tue, 17 Jul 2012 12:07:22 -0600 Received: from d03relay03.boulder.ibm.com (d03relay03.boulder.ibm.com [9.17.195.228]) by d03dlp02.boulder.ibm.com (Postfix) with ESMTP id 4F9F03E4005E; Tue, 17 Jul 2012 18:07:20 +0000 (WET) Received: from d03av04.boulder.ibm.com (d03av04.boulder.ibm.com [9.17.195.170]) by d03relay03.boulder.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q6HI6smD074184; Tue, 17 Jul 2012 12:07:01 -0600 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 q6HI6mKD024619; Tue, 17 Jul 2012 12:06:49 -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 q6HI60xg018372; Tue, 17 Jul 2012 12:06:02 -0600 From: John Stultz To: stable@vger.kernel.org Cc: Richard Cochran , Prarit Bhargava , Thomas Gleixner , Linux Kernel , John Stultz Subject: [PATCH 02/11] 2.6.35.x: ntp: Correct TAI offset during leap second Date: Tue, 17 Jul 2012 14:05:33 -0400 Message-Id: <1342548342-19683-3-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-7408-0000-0000-000006D6C45B X-Gm-Message-State: ALoCoQlVx63Cr8/3i5naSeOPZdMBEDcY8NDjZHzyEQ7NPFte4jsXqwiHIyd/nV4PUKrw9WJdCj2S 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 67ef677..272e169 100644 --- a/kernel/time/ntp.c +++ b/kernel/time/ntp.c @@ -208,6 +208,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"); } @@ -222,7 +223,6 @@ int second_overflow(unsigned long secs) } break; case TIME_OOP: - time_tai++; time_state = TIME_WAIT; break;