Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp238053pxu; Fri, 4 Dec 2020 01:57:02 -0800 (PST) X-Google-Smtp-Source: ABdhPJxI6U8yurbA7qFUGzNyfJ4ynyuGK61dICFpTzgp3xn6m8CMIw1kLS1QPfRLJohDBy+zkWj6 X-Received: by 2002:a17:906:391b:: with SMTP id f27mr6146655eje.195.1607075822441; Fri, 04 Dec 2020 01:57:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607075822; cv=none; d=google.com; s=arc-20160816; b=vPobYBS2ZthBx638FpiIk1V+Ed6ZzhTfsHfdHgW5/MJA9/x0nNCOQyeJwh7J5koKzv aCotj0Dnnth0FRCVIPnjeSJBETzkPGgrUsAWqxGjhyjQ4EEQIrSalAuFI3EGZJl/eoem pRsjtSvkJ2U+sqUA04obyzA53+XmTskADBGyqj4aLI/+swB5Pr/U9Ed+5P4MdDBTcbGS MGuXxf0qiz6mchvLrHUKeXhmvsrVYXWayVx/GV5qDhOqP2fg2vtDwP/pChVZsaLyMON5 gkjSAPDkzqWFHez9I/3CKsYKy/NPglO0Bvv8f81tRBOc+sbG9OsgN1jj+fKuUjyCe/8N ul1A== 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=Zg/PmvJz744DtAnMi5RhtesKBF3AbPvEx8zmwmZkfz8=; b=T/jhmnI/C+sDSlMyukwtICVXCLKnXN6tQGTo3yrJRijaNR/QSDJvjMaJqYAhbR8eTw I7uX/sFWeZp6HOEn4m+KDA92QZGex82pZbrljf07Hv8oQQIG7kaDeAqZpRbUugXUN7Fu hz6wBpxOAig+txdrawNv2Qwlj7j0QPhCgpgaiO50c4rLQjCC5/968NxGQ/6zXLUm1909 pwO4P0PtT5yp9IAEawFWlzH9nERYAJQiEJed8QQa3vb2hhsh0kMARky3GmG+r94+2W3E 9iTejYd0EzEaYnwhPzkED4VCa2hhZlkLFAet/RCko4t7FHQZV2dcE8+MtmaE0D6VZKtE Q+BQ== 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 b11si2577055edw.463.2020.12.04.01.56.39; Fri, 04 Dec 2020 01:57:02 -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 S2387739AbgLDJwW (ORCPT + 99 others); Fri, 4 Dec 2020 04:52:22 -0500 Received: from relay9-d.mail.gandi.net ([217.70.183.199]:54397 "EHLO relay9-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387601AbgLDJwV (ORCPT ); Fri, 4 Dec 2020 04:52:21 -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 relay9-d.mail.gandi.net (Postfix) with ESMTPSA id 8EE29FF810; Fri, 4 Dec 2020 09:51:38 +0000 (UTC) Date: Fri, 4 Dec 2020 10:51:38 +0100 From: Alexandre Belloni To: Thomas Gleixner Cc: Jason Gunthorpe , 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: <20201204095138.GG74177@piout.net> References: <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> <20201203161622.GA1317829@ziepe.ca> <87zh2ubny2.fsf@nanos.tec.linutronix.de> <20201203220027.GB74177@piout.net> <87im9hc3u2.fsf@nanos.tec.linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87im9hc3u2.fsf@nanos.tec.linutronix.de> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 04/12/2020 10:34:13+0100, Thomas Gleixner wrote: > On Thu, Dec 03 2020 at 23:00, Alexandre Belloni wrote: > > On 03/12/2020 22:05:09+0100, Thomas Gleixner wrote: > >> 2) I2C/SPI ... > >> > >> tsched t0 t1 t2 > >> transfer(newsec) RTC update (newsec) RTC increments seconds > >> > >> Lets assume that ttransfer = t1 - t0 is known. > > > > Note that ttransfer is one of the reason why setting set_offset_nsec > > from the RTC driver is not a good idea. The same RTC may be on busses > > with different rates and there is no way to know that. I think that was > > one of my objections at the time. > > > > ttransfer is not a function of the RTC model but rather of how it is > > integrated in the system. > > Yes, but it's the right place to store that information. > > It's a fundamental problem of the RTC driver because that's the one > which has to be able to tell the caller about it. The caller has > absolutely no way to figure it out because it does not even know what > type of RTC is there. > > So either the RTC knows the requirements for tsched, e.g. the MC14xxx > datasheet, or it can retrieve that information from DT or by querying > the underlying bus mechanics for the xfer time estimate or just by > timing an xfer for reference. > What I do from userspace is that the caller is the one estimating the transfer time and this works very well. I really think that the ntp code could do just the same. -- Alexandre Belloni, Bootlin Embedded Linux and Kernel engineering https://bootlin.com