Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp3986540yba; Wed, 17 Apr 2019 02:03:25 -0700 (PDT) X-Google-Smtp-Source: APXvYqz1ELTbDi/sj9gQY7T8SBHoMVKWMJd+MY2D7an/iIXYW+6V3pOOYS8UIXJL/SEys+dGps6u X-Received: by 2002:a17:902:8d83:: with SMTP id v3mr86203623plo.283.1555491805251; Wed, 17 Apr 2019 02:03:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555491805; cv=none; d=google.com; s=arc-20160816; b=h4dP2dfd8J0trB7bMT9A65HXuJz/hHaudbhP6mvHi1Eo1WeVffoW8nYb5BV+9xTvt6 Z7Pzetz2vbu/obvcvjDaMas4E3go6DFPijjYNOdPCQgOUnDjB9ZEfoonMk0esdb9GFS/ LzfX+JAfaaDoMAsC0BaYZR3TGVePymfrGyiLjqSSAkydFNn5F8jMz6OQKffZYVGQBLXX nM98P8C+Jylhh3IX/FqNR6gsO1j8Xm30Sv7u9cYntwvoYVHdWst+rTtOeG+aoIKXwpH/ piRhsjyB1dwXlsf5r8IxDW+C9IS2ipBpE8NDbnntnXAKmZ2hqfbzdgYU0+d8JSBN2fZl VgtQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version; bh=IVXQ9lQyi2Q5wZjTisjUyZ0XWSaOWQ+YMO9bua4jwlY=; b=kq8vds2TZjgtJWVRC1wg/SxUoov86zh7CN9NjVOzz/cMRscRH2E+fhUh/7GHMlaSXq WBITDG2/MqweL9B19C+3VEAQf6apZHW8LfMH0cz6EPk8Tq6+UZb0GpEBtVB+WnwhmDHK Z7UB3MAYxM7U7DiT+Lr6vhXeo3Cs9SLXcvR9qgiW4g6RSuDKdvIesmWr7TnuEzLJ69px Jv23W+1jOHU3UUtZ/AdPj6NPm0COQdtYMFKJR0F3ZCpdhaxw3teSYTvwfuHMn5O3uynf sDo/rXsJxs2m7BJLT7DSOWJjR6WQEhMkiqIcvsxH/ioaTdk5mURDAKoFdGZ2rGmeMbEZ d1KQ== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e184si44057065pfe.118.2019.04.17.02.03.09; Wed, 17 Apr 2019 02:03:25 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731435AbfDQJAg (ORCPT + 99 others); Wed, 17 Apr 2019 05:00:36 -0400 Received: from mail-ot1-f67.google.com ([209.85.210.67]:39160 "EHLO mail-ot1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726237AbfDQJAf (ORCPT ); Wed, 17 Apr 2019 05:00:35 -0400 Received: by mail-ot1-f67.google.com with SMTP id f10so20041973otb.6 for ; Wed, 17 Apr 2019 02:00:35 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=IVXQ9lQyi2Q5wZjTisjUyZ0XWSaOWQ+YMO9bua4jwlY=; b=cd/Zr4PtIrLfMwAjbogs+4M+nMfxEvVqGL0gD4bNoXsG1ruZ+1km1++iMT6LYC/1Xi P+ZiSEEU/oRsgTz7Gg9xzNkE/HHxH+8xACKidzU1E3SVfR6OVkZaA/mKAfjYximqVSrz f2AG611RuxgpIhzaMOhR2kBK+7wgw/7+W1QOmexXOD3XNrr29GLlyz5+akE/VmWcJ+jf FUo5VDSpKZ8z+RJQ1wdgd9jZG8YYTlFdp7kfVytIslK7sE6A/eHyyFu+wXDGEs/FcLSP uEq/IzD4SWCODdXxBia1uTYxT9olAq2QB5IWNzAaYaGoNjIva2vuqlYKWF4RxA9Np+El IGBw== X-Gm-Message-State: APjAAAVOA01coy2pFjXcwVCoM/Zp77F9FzQ70eM6mMnMDkeSpLE+pyIV HSnyrJmp/B4BuO4s1rPbBGVfcsIl/7ZOUulH/xYS3g== X-Received: by 2002:a9d:6941:: with SMTP id p1mr52991357oto.64.1555491634828; Wed, 17 Apr 2019 02:00:34 -0700 (PDT) MIME-Version: 1.0 References: <20190417084833.7401-1-mlichvar@redhat.com> In-Reply-To: <20190417084833.7401-1-mlichvar@redhat.com> From: Ondrej Mosnacek Date: Wed, 17 Apr 2019 11:00:23 +0200 Message-ID: Subject: Re: [PATCH] ntp: Allow TAI-UTC offset to be set to zero To: Miroslav Lichvar Cc: Linux kernel mailing list , Thomas Gleixner , John Stultz , Richard Cochran , Prarit Bhargava Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Apr 17, 2019 at 10:48 AM Miroslav Lichvar wrote: > 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. > > Cc: Thomas Gleixner > Cc: John Stultz > Cc: Richard Cochran > Cc: Prarit Bhargava > Suggested-by: Ondrej Mosnacek > Signed-off-by: Miroslav Lichvar Thanks for sending the patch! Maybe you (or the committer) could consider adding: Fixes: 153b5d054ac2 ("ntp: support for TAI") so that it gets to the stable kernels as well. > --- > 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) > -- > 2.17.2 -- Ondrej Mosnacek Software Engineer, Security Technologies Red Hat, Inc.