Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp608907pxu; Thu, 3 Dec 2020 08:20:40 -0800 (PST) X-Google-Smtp-Source: ABdhPJyOKw0jBfbgf2y7PWbKNGipPKhnm/f/FQgOyrrul4kP4trwFlR2We3VOXmsvd4AeN+LXG0h X-Received: by 2002:a17:906:6693:: with SMTP id z19mr3150701ejo.376.1607012440581; Thu, 03 Dec 2020 08:20:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607012440; cv=none; d=google.com; s=arc-20160816; b=Pbql0uR96EZNKtN+nVU9Q3Sfe2uXprpRDM0Qeatf4doQnrV36pDv91WXfd+QEzrQFs v1wj2Z36LB/NN2JKrZdOgcPVwfgAgR0RzBE93imLqEf5WJuLwN0srs8vOtWfqRopDU9b 8gcYXq3WU6NXA1tp953ZefO+8XyHQBKC+2+f00L1+0YiWxQg3iGu+JQGVQpK21jXbVYc 1QRAAdKKnj75rb1a8cpfQjnQiCO2u7E0frygJKzg1eS4KsCYIeZAYzaEW9x75d0I62Gq N82AjIlJFMWIQgK6SpzuU2/gRIwKK5pCHsz0mfVtNEtA2y75xykrxzpqq3WI4kM9x9qq eCrg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=nqxHEehCvii0bTM+IyLO2PbX9ekRddRQu8/eqzIhyOU=; b=NdpOMCI1DTS5FMACJzS5kK9sAP+6LX/0cJNs/A/2K3TPlF4HYK5aoxeRPK+EkYiRE2 MBbaF0JjtzurZXBHAIAahiAYpEtJQCq1OEs0IY9wH91L3hej4rXGypWafqSGPf7yvBOL vyq0nPmDW2vDjPnSUThLK/+MU6WiPEYPz618HNyiQJapI1ySFvDCHEweHAimlfZKriWx oEYHYkOXwHOxvLc5vqcB6Sz6VsrplfGlGRmOBoPfFwewSgWqoJg9086+FpCyXj72KNAQ Gw6GekYYxmsVSqG+6ewM/ggov57fVGgyrOBTZ3OKdwqkkNhP57+5UxKNbJK30gnW4N6B CidQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ziepe.ca header.s=google header.b=GAc8adqN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e1si1317479ejf.335.2020.12.03.08.20.15; Thu, 03 Dec 2020 08:20:40 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@ziepe.ca header.s=google header.b=GAc8adqN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389349AbgLCQRF (ORCPT + 99 others); Thu, 3 Dec 2020 11:17:05 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56820 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389290AbgLCQRF (ORCPT ); Thu, 3 Dec 2020 11:17:05 -0500 Received: from mail-qk1-x742.google.com (mail-qk1-x742.google.com [IPv6:2607:f8b0:4864:20::742]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3AAD0C061A4F for ; Thu, 3 Dec 2020 08:16:25 -0800 (PST) Received: by mail-qk1-x742.google.com with SMTP id i199so2578988qke.5 for ; Thu, 03 Dec 2020 08:16:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=nqxHEehCvii0bTM+IyLO2PbX9ekRddRQu8/eqzIhyOU=; b=GAc8adqNopO2UxLM7/fwMnNg6vA9r6i6BetSSJLPScfhjerYyAldA1uJoM98PM7vBL rXIA6MDX/RpJeevg7cZAsDi+k9chPnnh2L0yLbbwWR23vi6WMn5gcloKgSKLfJTYmfrW gm0zSZzz/hea6375hJiQmOoDpMLSL19wkPQbxFDZ5ybJaS23c3MJ02FJoasFOEoRSlEK Nba7Nt4ZrY+Cdd1ESLexMNkeyAxOe15Iqb7BFqOr5S62iloLJ0rhPaqqfl91FCfDJ+d7 rS9Qcj/Q6s4lLHJOaQxW5Rx/IgB5jBb6YowRC415Rr174bB20CV9MU2jQiPug/cDYbrJ UL8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=nqxHEehCvii0bTM+IyLO2PbX9ekRddRQu8/eqzIhyOU=; b=F+Z/mVg7EzaL5Y7boGjKfjzX78+0xSd0Oe+Du37+f+Jwq9l5VaZCCjntJ60Afkcm0n JrSEmV2gtIQTDuyP9F3N+wCKpZEipTtZGtIc3H1QkgOhgBZ/yHv42XJfq9X9WDLapFpD RcDl3u4eTbYqE5hXrWvF6YM60hcQ97zTIyzbPnXqYfYVps1OppBIbkjUFqN9uKLwILEe sWHwV+aMg45rZe4838k6fJmdqu9OuAvhn51CRV7pyhGSbW/PVVwqNvkmQtEtzpz/vfy5 zBN8NhPivoLwZIS82WWBuwDjMhn/TzlYT0RqOpcSB+nwndGI7Zx/yeH5Ru46+AaXOc1E uZSA== X-Gm-Message-State: AOAM5339eG0Ces/RBrISPym6IWKyh10EFGBbhNpJVlYM/gl6r6u5y52j mWvHq79xHSv7rM7CUG8vixVIyg== X-Received: by 2002:a37:5185:: with SMTP id f127mr3594869qkb.225.1607012184500; Thu, 03 Dec 2020 08:16:24 -0800 (PST) Received: from ziepe.ca (hlfxns017vw-156-34-48-30.dhcp-dynamic.fibreop.ns.bellaliant.net. [156.34.48.30]) by smtp.gmail.com with ESMTPSA id j21sm1524129qtp.10.2020.12.03.08.16.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Dec 2020 08:16:23 -0800 (PST) Received: from jgg by mlx with local (Exim 4.94) (envelope-from ) id 1kkrHK-005XLH-RZ; Thu, 03 Dec 2020 12:16:22 -0400 Date: Thu, 3 Dec 2020 12:16:22 -0400 From: Jason Gunthorpe To: Thomas Gleixner Cc: Alexandre Belloni , Miroslav Lichvar , linux-kernel@vger.kernel.org, John Stultz , Prarit Bhargava , Alessandro Zummo , linux-rtc@vger.kernel.org, Peter Zijlstra Subject: Re: [PATCH] rtc: adapt allowed RTC update error Message-ID: <20201203161622.GA1317829@ziepe.ca> References: <20201201171420.GN1900232@localhost> <20201201173540.GH5487@ziepe.ca> <87mtywe2zu.fsf@nanos.tec.linutronix.de> <20201202162723.GJ5487@ziepe.ca> <87a6uwdnfn.fsf@nanos.tec.linutronix.de> <20201202205418.GN5487@ziepe.ca> <874kl3eu8p.fsf@nanos.tec.linutronix.de> <87zh2vd72z.fsf@nanos.tec.linutronix.de> <20201203021047.GG3544@piout.net> <87pn3qdhli.fsf@nanos.tec.linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87pn3qdhli.fsf@nanos.tec.linutronix.de> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Dec 03, 2020 at 04:39:21PM +0100, Thomas Gleixner wrote: > The logic in sync_cmos_clock() and rtc_set_ntp_time() is different as I > pointed out: sync_cmos_clock() hands -500ms to rtc_tv_nsec_ok() and > rtc_set_ntp_time() uses +500ms, IOW exactly ONE second difference in > behaviour. I understood this is because the two APIs work differently, rmk explained this as: > 1. kernel/time/ntp.c assumes that all RTCs want to be told to set the > time at around 500ms into the second. > > 2. drivers/rtc/systohc.c assumes that if the time being set is >= 500ms, > then we want to set the _next_ second. ie one path is supposed to round down and one path is supposed to round up, so you get to that 1s difference.. IIRC this is also connected to why the offset is signed.. Jason