From patchwork Tue Jul 17 07:05:15 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: john stultz X-Patchwork-Id: 10028 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 EA49424036 for ; Tue, 17 Jul 2012 07:05:44 +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 BA489A181CC for ; Tue, 17 Jul 2012 07:05:44 +0000 (UTC) Received: by yenq6 with SMTP id q6so67920yen.11 for ; Tue, 17 Jul 2012 00:05:44 -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=hs+j8f9+lXNM+y2yrCLG4Q2SMzGzklbr0MP1DLLV+0rgNsAlV3lUqxDlkhLZWBd1yQ foZOi93NnQub0hQA6dnknMr0zMtN4EHt3nqvNKaa5quZccOMBhjWM5bnI/kM5YrOCaEL PzqLL4Ysvg46nc6MAVOnESfDIdKBXY5CqS3yg1o/MhIKEzHwE7aVegmt4zSLpGb4NqSe X27+NigCtSKTw6aAI+verCHQRl6LvNdLIvMItA1mhhozBf8xzLC2YecXanlyPt8YqGUg 1TuTp5FpbQEszqXo4pLq8QWeuM2UVxC6FgjfY81TQq4e7xvG1trGbTWI7t8B3luqQxFu duBQ== Received: by 10.50.87.227 with SMTP id bb3mr425466igb.57.1342508744035; Tue, 17 Jul 2012 00:05:44 -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 lc2csp15894ibb; Tue, 17 Jul 2012 00:05:43 -0700 (PDT) Received: by 10.50.156.194 with SMTP id wg2mr447833igb.46.1342508743466; Tue, 17 Jul 2012 00:05:43 -0700 (PDT) Received: from e1.ny.us.ibm.com (e1.ny.us.ibm.com. [32.97.182.141]) by mx.google.com with ESMTPS id de9si15266707igb.40.2012.07.17.00.05.43 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 17 Jul 2012 00:05:43 -0700 (PDT) Received-SPF: pass (google.com: domain of johnstul@us.ibm.com designates 32.97.182.141 as permitted sender) client-ip=32.97.182.141; Authentication-Results: mx.google.com; spf=pass (google.com: domain of johnstul@us.ibm.com designates 32.97.182.141 as permitted sender) smtp.mail=johnstul@us.ibm.com Received: from /spool/local by e1.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 17 Jul 2012 03:05:42 -0400 Received: from d01dlp02.pok.ibm.com (9.56.224.85) by e1.ny.us.ibm.com (192.168.1.101) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Tue, 17 Jul 2012 03:05:40 -0400 Received: from d01relay06.pok.ibm.com (d01relay06.pok.ibm.com [9.56.227.116]) by d01dlp02.pok.ibm.com (Postfix) with ESMTP id E0E0B6E805C; Tue, 17 Jul 2012 03:05:39 -0400 (EDT) Received: from d01av04.pok.ibm.com (d01av04.pok.ibm.com [9.56.224.64]) by d01relay06.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q6H75d5f35323988; Tue, 17 Jul 2012 03:05:39 -0400 Received: from d01av04.pok.ibm.com (loopback [127.0.0.1]) by d01av04.pok.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id q6H75bGt016128; Tue, 17 Jul 2012 03:05:38 -0400 Received: from kernel.stglabs.ibm.com (kernel.stglabs.ibm.com [9.114.214.19]) by d01av04.pok.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id q6H75aBK015997; Tue, 17 Jul 2012 03:05:37 -0400 From: John Stultz To: stable@vger.kernel.org Cc: Richard Cochran , Prarit Bhargava , Thomas Gleixner , Linux Kernel , John Stultz Subject: [PATCH 02/11] 3.2.x: ntp: Correct TAI offset during leap second Date: Tue, 17 Jul 2012 03:05:15 -0400 Message-Id: <1342508724-14527-3-git-send-email-johnstul@us.ibm.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1342508724-14527-1-git-send-email-johnstul@us.ibm.com> References: <1342508724-14527-1-git-send-email-johnstul@us.ibm.com> X-Content-Scanned: Fidelis XPS MAILER x-cbid: 12071707-6078-0000-0000-00000D4820EB X-Gm-Message-State: ALoCoQkR01PmrV1ciLEi10YLjMvCevWdBS0uJ968nMKj/+yzJEcgPvMdZ2WfOWPZdZROKz+fTQXK 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;