Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp229804pxu; Fri, 4 Dec 2020 01:39:47 -0800 (PST) X-Google-Smtp-Source: ABdhPJypj0Nnlo37OEhest/lZejywHnhrI1dUtAjFtnI9y4mVCWN31w1Got5Re9MbsmA7j4sSEo6 X-Received: by 2002:a17:907:3fa3:: with SMTP id hr35mr6239958ejc.71.1607074787512; Fri, 04 Dec 2020 01:39:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607074787; cv=none; d=google.com; s=arc-20160816; b=kVi+H96+iYt6H0ukLgnxfD5SzF2a02/NFT78Skqe5WXEf8sUnjYFZJ97cqYX6jSQjn wPViO1xRlIDfkud9ZNzeXw8b40hRrEvF4/5vr6CyN3DBG3Pv/4vwYWGtfRDrofM4Rt0O w6pkLAPx7LCxOBC+yJIWhOXP5pSST6QTctLy23nxVFO21Hf3PtaVJASnzTgtWlDl/6kL PrCrRvPayx9JKB8kmxv9RbE+q7OXj9bGri2LDbwCKibJtV5JGxaX074bhKJg2ihl0OIV DwAG4RVFA9iZz/QaTLHT9WUZYHbUzgy6NHHqCcm5XZdSRRGosoofYd8+bVhxZ7CYwp9H GHYQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:references :in-reply-to:subject:cc:to:dkim-signature:dkim-signature:from; bh=hgQbpciJbizYKA4AVJ09dODrpMGMg9MJPg1/jfecOMY=; b=JiKQvBFXysm9JeHF+8AI2r4RB3uxJfO1/SU+1LvP8JsGEntko0EsyggSYLJZhX2E7K WLYUKBNWyIK1R3NUpIgMJ8Wg0CeU7yzkWyMKfvhFxemK6k+QWn4FgmeY4iE/pLebmYii ESoTiqtqI5LhvVjwHKo4adrhRpromc2Hm8Pa5LiieQMa3YA+C3rvn8tm1BdHYF6133sA G+D9Uid6Aw8yHoPke2x3I8ckm4/2J8N99PCGnlRdxSqT3ZrtWdY6kK8w63+KxUNWdkWW QP+WS+wJ2y6um/vvgrVF+bNzNCEHcDXTxG1I913L2MjDMDJL0VxLjTe14zwUUp390L26 XfJg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=YupU4aqa; dkim=neutral (no key) header.i=@linutronix.de; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x18si1164430ejd.193.2020.12.04.01.39.24; Fri, 04 Dec 2020 01:39:47 -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=@linutronix.de header.s=2020 header.b=YupU4aqa; dkim=neutral (no key) header.i=@linutronix.de; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728337AbgLDJe5 (ORCPT + 99 others); Fri, 4 Dec 2020 04:34:57 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48340 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726394AbgLDJe4 (ORCPT ); Fri, 4 Dec 2020 04:34:56 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3F812C061A4F; Fri, 4 Dec 2020 01:34:16 -0800 (PST) From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1607074454; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=hgQbpciJbizYKA4AVJ09dODrpMGMg9MJPg1/jfecOMY=; b=YupU4aqaYx1YHrhVbQZs2jdm69vyI4x5Q9CEEyOxbVko6CVMZNbrqLo1VKkQqlVzXYSpDY eQbdS1mOq82fSzNbm5RwhA6OYGI87lvQFxoIe7JGpvmho87nDWgCWhlAMIuEKKtnIZIcSw GaMUC576+VUDtNqv5aHgDKNPJszGJs9ugYEFqVrkh1rQfYVlsZc+0aLrCe7H8Ztq+azwwZ g1nrWhROkmSjj/DN5m9jD7Jj1D/Z1YaQMN9mlFwcRjPkWPYS7M70hGJuS3gyOYdoJgCFRR eyV6A6QL1GqVu+Q07+xvhEo3UGHCtyyTD7NGpmt13bu8MKVimYa0LPv3+xmfbA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1607074454; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=hgQbpciJbizYKA4AVJ09dODrpMGMg9MJPg1/jfecOMY=; b=+pTOGJuA4vZzLRir7Sj//2FAE/l7NuxgaQ+9p3xm1eA9ebbxnRtBajdnDBPuW73ceGQhPm J0/kJNnWXnjP/MBw== To: Alexandre Belloni 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 In-Reply-To: <20201203220027.GB74177@piout.net> References: <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> <20201203161622.GA1317829@ziepe.ca> <87zh2ubny2.fsf@nanos.tec.linutronix.de> <20201203220027.GB74177@piout.net> Date: Fri, 04 Dec 2020 10:34:13 +0100 Message-ID: <87im9hc3u2.fsf@nanos.tec.linutronix.de> MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. Thanks, tglx