Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp537650yba; Thu, 9 May 2019 01:55:50 -0700 (PDT) X-Google-Smtp-Source: APXvYqw0ro6ep8WFODL//JwMyCMX4P4PLcDASDCXOj+BzfT4bxp7he/XbjnFOfTYn0hYE63QyS9F X-Received: by 2002:a17:902:e40f:: with SMTP id ci15mr3555788plb.280.1557392149943; Thu, 09 May 2019 01:55:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557392149; cv=none; d=google.com; s=arc-20160816; b=CcuDprV8o0rq5IcNeRJhTjfElUp6atcuTo38+PPi7tLZ5wtM+lJ6BMtfwJWEUfMZnc JIYdrKuVqlaLtBJrnWyxxSHm+ZJ6gaEFtODa2fC86YMVhPl/pe2DYrhxEQdSz+u32HnP vZOgi+Vhd9FxCRc+U/x1gjWeetyqfuluMP+5I3sUSUilXjvzuDiNK9wZRvXY5EvReiS3 /acUr28NCXyiJSUHTPqZGM9rqSYNmh81X5U1mhsVIkJHFZU2jo+IMfyG3o3b9WZtMw6R 9jZVmnUNHaCbOtOtln6cTnHIOvwFsxbOteznrkM3Zr+3yow3Zqx2qgSgc0q1gpC+6s0i fSjQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-disposition :content-transfer-encoding:mime-version:robot-unsubscribe:robot-id :git-commit-id:subject:to:references:in-reply-to:reply-to:cc :message-id:from:date:dkim-signature:dkim-filter; bh=UAplFKrGueTVtx1S3VgkdblcoegBhRfJCEfTMM6XrHg=; b=04py4xsHZ0AaY6NHG9TeMT6Ft8bHrRoypvsE62ZAIpVcCZF/ObKdB8CTEBduARBHxe i4tqOXMPxF2Sg9MjCsp7UtSODNVkz26ickRYZEPfpEBJyGy3KztYoskqG9/DlFvVX1oe JxdFlcqeJWvKYwjdls/1mysZ4vQAE+MC+RXW8HhGxzHEbNWdcNCOIPmovCQYRSFVF0lH hYOba8sgVeTFu/ZOAAsmfitjHNVfQSJWVLYAtCrCQrQ4yZvrR2ExwrkZYQyYQCX+HdCF 0dBv8DKrRS1AAifcxiytlXPDGGGPsWJ2FxQNpkdQ/5tClJKj+mBJRvgMOyK+kf8wTqsJ 4I+Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@zytor.com header.s=2019041745 header.b=kpYQBalW; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zytor.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 3si1962012pll.281.2019.05.09.01.55.34; Thu, 09 May 2019 01:55:49 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@zytor.com header.s=2019041745 header.b=kpYQBalW; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zytor.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726711AbfEIIxL (ORCPT + 99 others); Thu, 9 May 2019 04:53:11 -0400 Received: from terminus.zytor.com ([198.137.202.136]:43547 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725872AbfEIIxK (ORCPT ); Thu, 9 May 2019 04:53:10 -0400 Received: from terminus.zytor.com (localhost [127.0.0.1]) by terminus.zytor.com (8.15.2/8.15.2) with ESMTPS id x498qruH1467753 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Thu, 9 May 2019 01:52:53 -0700 DKIM-Filter: OpenDKIM Filter v2.11.0 terminus.zytor.com x498qruH1467753 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zytor.com; s=2019041745; t=1557391974; bh=UAplFKrGueTVtx1S3VgkdblcoegBhRfJCEfTMM6XrHg=; h=Date:From:Cc:Reply-To:In-Reply-To:References:To:Subject:From; b=kpYQBalWYRp7F2dzQmCA4Y+QvCgpLQHnz4pa7Yf9Y3wL5BFoxgUkWdzn0rxXmesHE 0DU3dCMKSp2cAtdquZSRY+tzfGjeQXKqNCHxZdMbCCIw3Sm82avnTsvb2jzNY/YGe3 /vaoWxMft6OFicbpFpKATINgY6omS3LjR8Y7oKlSLX3J0BGtncxkvKc8IPVEPklXu2 wLy3vKHT/RlfL+UVNPHZmKpXqyNicVOug5MlK6DBtdph1JUrZG0Zzz2SQ43h45D9MQ x5QWVDhADjUG9aor7hlFyKlQnfQm8nIoedhxI07D0ng8aNb8wfNn1BlK3OIcVo65br a3ndTY2cTMumA== Received: (from tipbot@localhost) by terminus.zytor.com (8.15.2/8.15.2/Submit) id x498qrgG1467750; Thu, 9 May 2019 01:52:53 -0700 Date: Thu, 9 May 2019 01:52:53 -0700 X-Authentication-Warning: terminus.zytor.com: tipbot set sender to tipbot@zytor.com using -f From: tip-bot for Miroslav Lichvar Message-ID: Cc: hpa@zytor.com, richardcochran@gmail.com, tglx@linutronix.de, john.stultz@linaro.org, mingo@kernel.org, mlichvar@redhat.com, prarit@redhat.com, omosnace@redhat.com, linux-kernel@vger.kernel.org Reply-To: prarit@redhat.com, omosnace@redhat.com, mlichvar@redhat.com, linux-kernel@vger.kernel.org, tglx@linutronix.de, mingo@kernel.org, john.stultz@linaro.org, richardcochran@gmail.com, hpa@zytor.com In-Reply-To: <20190417084833.7401-1-mlichvar@redhat.com> References: <20190417084833.7401-1-mlichvar@redhat.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:timers/urgent] ntp: Allow TAI-UTC offset to be set to zero Git-Commit-ID: fdc6bae940ee9eb869e493990540098b8c0fd6ab X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, FREEMAIL_FORGED_REPLYTO,T_DATE_IN_FUTURE_96_Q autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on terminus.zytor.com Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: fdc6bae940ee9eb869e493990540098b8c0fd6ab Gitweb: https://git.kernel.org/tip/fdc6bae940ee9eb869e493990540098b8c0fd6ab Author: Miroslav Lichvar AuthorDate: Wed, 17 Apr 2019 10:48:33 +0200 Committer: Thomas Gleixner CommitDate: Thu, 9 May 2019 10:46:58 +0200 ntp: Allow TAI-UTC offset to be set to zero The ADJ_TAI adjtimex mode sets the TAI-UTC offset of the system clock. It is typically set by NTP/PTP implementations and it is automatically updated by the kernel on leap seconds. The initial value is zero (which applications may interpret as unknown), but this value cannot be set by adjtimex. This limitation seems to go back to the original "nanokernel" implementation by David Mills. Change the ADJ_TAI check to accept zero as a valid TAI-UTC offset in order to allow setting it back to the initial value. Fixes: 153b5d054ac2 ("ntp: support for TAI") Suggested-by: Ondrej Mosnacek Signed-off-by: Miroslav Lichvar Signed-off-by: Thomas Gleixner Cc: John Stultz Cc: Richard Cochran Cc: Prarit Bhargava Link: https://lkml.kernel.org/r/20190417084833.7401-1-mlichvar@redhat.com --- 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 92a90014a925..f43d47c8c3b6 100644 --- a/kernel/time/ntp.c +++ b/kernel/time/ntp.c @@ -690,7 +690,7 @@ static inline void process_adjtimex_modes(const struct __kernel_timex *txc, time_constant = max(time_constant, 0l); } - if (txc->modes & ADJ_TAI && txc->constant > 0) + if (txc->modes & ADJ_TAI && txc->constant >= 0) *time_tai = txc->constant; if (txc->modes & ADJ_OFFSET)