From patchwork Tue Jul 17 21:49:22 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: john stultz X-Patchwork-Id: 10085 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 7584B23E3D for ; Tue, 17 Jul 2012 21:50:13 +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 46080A1829A for ; Tue, 17 Jul 2012 21:50:13 +0000 (UTC) Received: by mail-yx0-f180.google.com with SMTP id q6so1043846yen.11 for ; Tue, 17 Jul 2012 14:50:13 -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=DjLb2qbJoqkoqbthl4QCYlVRdVAUfhNFYuEWAlNPLBU=; b=QreO1kmosuErZ6IwFdvMv8tYfH0U+xTgUBDjoJYl46uuY5T5z05/Re7d/ERTXdAUX3 pxb1w9UNBvivQJWQYzQtZKjYanTCgiXIp4gb83j1uF95PbdXiIczKTrWskYpUU0E1ibs wbcGeOOCWmfkBdCaGCEMrdVyRrJM/sEFtkVm+fsvX/ZmBMGU93Jn70xuyNLk9C/CGk/6 ggOME7l8LtIko2U8sutxdo3ppSXk0Ws/9g1VPIBw9jdXT3kZRHPG0eRvrm7Rif36YEoW a/4nc7Rm3FWvPreP8ouHTA7OybA74Tn53eFv2zxUJBmmYh72csXQ3LqKX/BX5lr2T1hG 15zg== Received: by 10.50.160.198 with SMTP id xm6mr248945igb.0.1342561812621; Tue, 17 Jul 2012 14:50:12 -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 lc2csp24881ibb; Tue, 17 Jul 2012 14:50:12 -0700 (PDT) Received: by 10.50.194.194 with SMTP id hy2mr167011igc.56.1342561812084; Tue, 17 Jul 2012 14:50:12 -0700 (PDT) Received: from e3.ny.us.ibm.com (e3.ny.us.ibm.com. [32.97.182.143]) by mx.google.com with ESMTPS id dg6si26546768icc.86.2012.07.17.14.50.11 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 17 Jul 2012 14:50:12 -0700 (PDT) Received-SPF: pass (google.com: domain of johnstul@us.ibm.com designates 32.97.182.143 as permitted sender) client-ip=32.97.182.143; Authentication-Results: mx.google.com; spf=pass (google.com: domain of johnstul@us.ibm.com designates 32.97.182.143 as permitted sender) smtp.mail=johnstul@us.ibm.com Received: from /spool/local by e3.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 17 Jul 2012 17:50:09 -0400 Received: from d01dlp02.pok.ibm.com (9.56.224.85) by e3.ny.us.ibm.com (192.168.1.103) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Tue, 17 Jul 2012 17:49:44 -0400 Received: from d01relay04.pok.ibm.com (d01relay04.pok.ibm.com [9.56.227.236]) by d01dlp02.pok.ibm.com (Postfix) with ESMTP id 4DC1A6E804D; Tue, 17 Jul 2012 17:49:44 -0400 (EDT) Received: from d03av05.boulder.ibm.com (d03av05.boulder.ibm.com [9.17.195.85]) by d01relay04.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q6HLnh3P325882; Tue, 17 Jul 2012 17:49:43 -0400 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 q6HLnbFN026522; 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 q6HLnZI0026401; Tue, 17 Jul 2012 15:49:37 -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.34.x: ntp: Correct TAI offset during leap second Date: Tue, 17 Jul 2012 17:49:22 -0400 Message-Id: <1342561771-55678-3-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-8974-0000-0000-00000B42611F X-Gm-Message-State: ALoCoQnSRWUDxBIkqiKVgjWMuLvFc7KacYKOfQqTrggtVEatQW2rmC1mNxZdE2eYSuon99IqYjxa 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 2522ab8..ec08c06 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;