Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp425605pxu; Fri, 4 Dec 2020 06:42:08 -0800 (PST) X-Google-Smtp-Source: ABdhPJwSEuGSSDPjNK6IBlneFkqIi5t6omXJWU+de0TZXL7PA1er1nwmNICuD8cp/iUxsqOfz9sP X-Received: by 2002:a50:ac86:: with SMTP id x6mr7967382edc.197.1607092927892; Fri, 04 Dec 2020 06:42:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607092927; cv=none; d=google.com; s=arc-20160816; b=h7O414z0EI1xsEKXweHDp+U9Ai9Wuak3yx/U9T3ZjjBGSoTJIDiL/CbJHAlTguxOMV WVA23DwS4EE2drI3ER76UGwbXhJ1l0ok2JAZShbkEVZSGduT764xa7azk+Q+p8DHIz/j 0JZFBo+YU6u2Y1pWocNxEK4NEuZjVLK7244W+Gn2sSBJd2rfW8D3GZXfY9VLEcango/t uYghK4QHyR6TxSoWFTIO8AeRBYgDcgvgEJ3KC0+awdfuxnaCUflusDNFDur9//OQp8DF 8SB2eo7hYKWNeY6HtsNcaPINx1nR2Kq+d7gFR0sK9SJnVctsXc9QV/04BuCx6VJC69Uw oQZw== 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; bh=e3MzcinmgPFBSPxe1AUt8Og5Jz90In83rPpMiCrMjVw=; b=MxJu4uNHb+P9wvl9pcNksGXClVXTGwRPrnSBLQHW6obQRc/ZLfQeYNgov+mR1dmWYA NUXrLQIh8GMGZmF2kqjrKLPvL3H2WguqiDo/JO+80f+5wv9DPDh/xSm/fE99DHOv0Duw 9/PmlpH6DDqQCtAzveuLy9XVLg5MJc5SmpqsQLGFL0gWFItPh/yG6h13W2w1i9H6Xyxr 9RODCqv99WDk1NjB3Cw8ML+x9pRfjLwEIz0XdMF1XZ7muKRokEiufCg8BJaLrKGfHPCq otyCqB2YpxQDsK3CzGlnnMYLJPHYA1cVYU880MbhPMTcLAXO35vhLw40xgAtZ1wpzwSU B7/A== ARC-Authentication-Results: i=1; mx.google.com; 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 i23si2924215edg.60.2020.12.04.06.41.44; Fri, 04 Dec 2020 06:42:07 -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; 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 S2387438AbgLDOiT (ORCPT + 99 others); Fri, 4 Dec 2020 09:38:19 -0500 Received: from relay6-d.mail.gandi.net ([217.70.183.198]:40271 "EHLO relay6-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725920AbgLDOiS (ORCPT ); Fri, 4 Dec 2020 09:38:18 -0500 X-Originating-IP: 86.194.74.19 Received: from localhost (lfbn-lyo-1-997-19.w86-194.abo.wanadoo.fr [86.194.74.19]) (Authenticated sender: alexandre.belloni@bootlin.com) by relay6-d.mail.gandi.net (Postfix) with ESMTPSA id 07B50C000D; Fri, 4 Dec 2020 14:37:35 +0000 (UTC) Date: Fri, 4 Dec 2020 15:37:35 +0100 From: Alexandre Belloni To: Jason Gunthorpe Cc: Thomas Gleixner , 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: <20201204143735.GI74177@piout.net> References: <874kl3eu8p.fsf@nanos.tec.linutronix.de> <87zh2vd72z.fsf@nanos.tec.linutronix.de> <20201203021047.GG3544@piout.net> <87pn3qdhli.fsf@nanos.tec.linutronix.de> <20201203161622.GA1317829@ziepe.ca> <87zh2ubny2.fsf@nanos.tec.linutronix.de> <87wnxybmqx.fsf@nanos.tec.linutronix.de> <20201203223646.GA1335797@ziepe.ca> <877dpxbu66.fsf@nanos.tec.linutronix.de> <20201204140819.GX5487@ziepe.ca> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201204140819.GX5487@ziepe.ca> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 04/12/2020 10:08:19-0400, Jason Gunthorpe wrote: > On Fri, Dec 04, 2020 at 02:02:57PM +0100, Thomas Gleixner wrote: > > > No magic sign calculation required if you look at it from the actual > > timeline and account the time between write and next second increment > > correctly. > > Yes, it is equivalent to break things into two values, and does look > to be more understandable as one can read at least one of the values > from a datasheet and the other could be estimated by timing a read > clock > If you want to read an RTC accurately, you don't want to time a read, what you want is to time an alarm. This is a common misconception and is, again, why hctosys in its current state is not useful. And because people using systohc are definitively using hctosys, this will still result in an up to 500ms error in the current time. As said, the price to pay for a proper solution will be an up to one second delay when booting which is not acceptable for most users. Is "fixing" systohc worth the effort and the maintenance cost? -- Alexandre Belloni, Bootlin Embedded Linux and Kernel engineering https://bootlin.com