Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp4492500ybc; Fri, 15 Nov 2019 05:38:20 -0800 (PST) X-Google-Smtp-Source: APXvYqzBGaIt1DdlzeZckLhovhYkWunvT3gwHODRfJhwY/zSqmvys9AAl7ZWAVFg89sPVWgF2UT1 X-Received: by 2002:a1c:2e8f:: with SMTP id u137mr14973348wmu.105.1573825100621; Fri, 15 Nov 2019 05:38:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573825100; cv=none; d=google.com; s=arc-20160816; b=BGWoKPojhRtTk49cMEB2n4z8jS+pCloyZnBSl4XWZ0cDTAMfWqxKhaeFvfOMLV6nfZ N2iR73vRzeaKLRdn28UteQxiiU2Fyqry4fasHD5GGVcRWD971sqMaq/weYYzte3MmbqK oAKhcdg43k1P/lNmtaiUYzK2NCKthSEgKnHEhRZM2YYH2ZqK+5QNkrKi23BChXEt2GXP l46N3+kSVpF8T+r7f1tng3axVPGTSzcrdVCdxA27HILLJn0vudvPWauqqr2Kki1ppl9N CdSiB7OnnPEtd2fe99Hr0GqEQ4HzNKBKwzAnJzLMIkTWE44dxGc4yo02T/hWdICnDCYq RCiA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=YmoMUwPTDT6LbX273Z7/oZEDwRJzmaexITUnhxHh6Jo=; b=N8XklPv69OiWStFpXyxG1I7xJrGRx6kHMy2PCNCq9vk38z+Y1k0IPmW/sG6om2nVBW /U6lReuiQyiEvckcZGOeB80pykoJlYup+i1dvxNzCJ5ZulWjPnqID0mVhVXi53Eg/GtL 6fhNiqjDR3MAZtvrCX96BZcPxS9XwL8xAxHxnZjILy6H6UOyNELN2CjQp1SP2ar9g0YE x5PNVM/cxlfWVJXZVq5yeObfwDoRkM2IkdG8n7eeg9abQ0c32VZ9B0vAND71AuVZcuKc 8VJ2tzociJBKqN2zYA4K8rBHen2DmMziQ4RBHCBvfZuosDE+Px7VEeQCzVgvARAfpDVH zHEg== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z4si5649285edp.329.2019.11.15.05.37.56; Fri, 15 Nov 2019 05:38:20 -0800 (PST) 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727558AbfKONgb (ORCPT + 99 others); Fri, 15 Nov 2019 08:36:31 -0500 Received: from relay9-d.mail.gandi.net ([217.70.183.199]:51689 "EHLO relay9-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727329AbfKONg3 (ORCPT ); Fri, 15 Nov 2019 08:36:29 -0500 X-Originating-IP: 90.66.177.178 Received: from localhost (lfbn-1-2888-178.w90-66.abo.wanadoo.fr [90.66.177.178]) (Authenticated sender: alexandre.belloni@bootlin.com) by relay9-d.mail.gandi.net (Postfix) with ESMTPSA id 07B40FF80D; Fri, 15 Nov 2019 13:36:27 +0000 (UTC) Date: Fri, 15 Nov 2019 14:36:27 +0100 From: Alexandre Belloni To: Steve Muckle Cc: Alessandro Zummo , linux-kernel@vger.kernel.org, linux-rtc@vger.kernel.org, kernel-team@android.com Subject: Re: [PATCH] rtc: class: support hctosys from modular RTC drivers Message-ID: <20191115133627.GT3572@piout.net> References: <20191106194625.116692-1-smuckle@google.com> <20191106231923.GK8309@piout.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.12.1 (2019-06-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 06/11/2019 15:37:49-0800, Steve Muckle wrote: > On 11/6/19 3:19 PM, Alexandre Belloni wrote: > > On 06/11/2019 11:46:25-0800, Steve Muckle wrote: > > > Due to distribution constraints it may not be possible to statically > > > compile the required RTC driver into the kernel. > > > > > > Expand RTC_HCTOSYS support to cover all RTC devices (statically compiled > > > or not) by checking at the end of RTC device registration whether the > > > time should be synced. > > > > > > > This does not really help distributions because most of them will still > > have "rtc0" hardcoded and rtc0 is often the rtc that shouldn't be used. > > Just for my own edification, why is that? Is rtc0 normally useless on PC for > some reason? > On PC, rtc0 is probably fine which is not the case for other architectures where rtc0 is the SoC RTC and is often not battery backed. > On the platforms I'm working with I believe it can be assured that rtc0 will > be the correct rtc. That doesn't help typical distributions though. > > What about a kernel parameter to optionally override the rtc hctosys device > at runtime? > What about keeping that in userspace instead which is way easier than messing with kernel parameters? > > Can't you move away from HCTOSYS and do the correct thing in userspace > > instead of the crap hctosys is doing? > > Yes, I just figured it's a small change, and if hctosys can be made to work > might as well use that. The fact is that hctosys is more related to time keeping than it is to the RTC subsytem. It also does a very poor job setting the system time because adding 0.5s is not the smartest thing to do. The rtc granularity is indeed 1 second but is can be very precisely set. -- Alexandre Belloni, Bootlin Embedded Linux and Kernel engineering https://bootlin.com