Received: by 10.192.165.148 with SMTP id m20csp3237623imm; Mon, 23 Apr 2018 03:07:36 -0700 (PDT) X-Google-Smtp-Source: AIpwx48lOj8J6ih+txg49b0j8YFH/TRuGlCC5nIeC6cYLz4nR9Ns1ASISRnDSE6F/sb77So2nQcj X-Received: by 10.99.139.202 with SMTP id j193mr15767381pge.300.1524478056776; Mon, 23 Apr 2018 03:07:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524478056; cv=none; d=google.com; s=arc-20160816; b=f2eNDCs2nH7jZxy/uYeMueloAsPFUinSs8d9V1E4lO0Wyxo/YiuFJBl8BCgPuPe2hF sJL1w24fi7eNv+AzpOZy+qlso8n9MRAShD4xptqojXR0IsqKZTOQ0Pwn94bh7aKqF6VC FarYHAw0lFRWnuJWi/DcH3wEB5VH9K6fkUVmG0FAskQxLnpK8KhBvFvnx0cjmIm1ib9Z 2QasrvV8WQd3bDLqnmEzuxsIn9/K3MtXUiThUQc99XXFz2+GaRNUoI/+euCGHiGaqIhr wQnT1X7vCqpNG+rSy3vZVJOcmL26tPXX1LxWemdi+IqUwZzFSFwb6NV5U81S3NfveuHx 2hbA== 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:arc-authentication-results; bh=VoeyiJrfF2dlT6ifDJmZw8Gn4a4CVE64U1lQhwcCWa4=; b=L9OMbx+c4aT5O6olEG01Wo4rlkMBUY4hD0wITh6kHLfS58bdiHvjlx8iSzx/vARYQe RPgiAlCmNluhterClt2q2YDMKuH8CYByrzjgskW0zg4GLny8AVb364USK1DZ+QtTK7JY XheDrLaNHoa0XCGd6RQ88Ia841fjcZeY+JmEjJ3ewuPTd4PlEwZ7Xp0UWYH9a12jIlBj G5yUG4L+jo9gVjLrpwp4WGsDZ/HEOb25ETPdUF1Q83/QODaUDyxGDbzX+sIrBd1ts5sh WvBoUI2vjfTtCU52f2X8KZWko776sak8QyT/UICVxNmRdDDwnOzsx8Eg86k86/YfzeAB CE4Q== 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 k2-v6si11372149plt.406.2018.04.23.03.07.22; Mon, 23 Apr 2018 03:07:36 -0700 (PDT) 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 S1754582AbeDWKFN (ORCPT + 99 others); Mon, 23 Apr 2018 06:05:13 -0400 Received: from mail.bootlin.com ([62.4.15.54]:60495 "EHLO mail.bootlin.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754404AbeDWKFK (ORCPT ); Mon, 23 Apr 2018 06:05:10 -0400 Received: by mail.bootlin.com (Postfix, from userid 110) id B3A1F2073C; Mon, 23 Apr 2018 12:05:08 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail.bootlin.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT shortcircuit=ham autolearn=disabled version=3.4.0 Received: from localhost (242.171.71.37.rev.sfr.net [37.71.171.242]) by mail.bootlin.com (Postfix) with ESMTPSA id 855032070D; Mon, 23 Apr 2018 12:04:58 +0200 (CEST) Date: Mon, 23 Apr 2018 12:04:59 +0200 From: Alexandre Belloni To: Arnd Bergmann Cc: Geert Uytterhoeven , Baolin Wang , Mark Brown , linux-m68k , Linux Kernel Mailing List , Linus Walleij , Finn Thain Subject: Re: [PATCH] m68k: Remove read_persistent_clock() Message-ID: <20180423100459.GB7218@piout.net> References: <0ca46228311ec615947e199def9fed62d70c1f07.1524118799.git.baolin.wang@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.5 (2018-04-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 23/04/2018 11:28:38+0200, Arnd Bergmann wrote: > Some extra background on this: > > read_persistent_clock64/read_persistent_clock is primarily needed when you > have a real time source that is better than the one exposed in the RTC class > driver. For platforms doing suspend/resume, the timekeeping code will > first try calling read_persistent_clock64() but fall back to the RTC > if that fails. > On only a few architectures like m68k, read_persistent_clock64() falls > back to reading the RTC hardware, which means it will still work even if > the RTC_DRV_GENERIC driver is not loaded. Removing that code will > still work correctly as long as the generic RTC driver does get loaded > before suspend. On platforms without suspend/resume, none of this matters. > > The other user of read_persistent_clock() is to set the initial time at boot. > This again can be done by the RTC subsystem if the correct RTC driver > is built-in and CONFIG_RTC_HCTOSYS is set. Alexandre is planning > to remove that option and instead force early user space to load the > RTC driver and then sync it manually using the sysfs knob for it. > There is still one use case that could require CONFIG_RTC_HCTOSYS, that's when the rootfs is on a network fs that requires the time to be roughly set before being accessed. This could be solved with an initramfs though (and that initramfs would be required if the RTC driver is a module anyway). I still need to check the 'avoid unnecessary fsck runs at boot time' claim but having the kernel modules and fsck on separate FS seems to be a very very specific use case to me. But yes, my plan is at least to get distros to stop enabling it by default on all their kernels because this led to multiple reports of systemd entering a loop and this not so nice workaround (still way better than having each driver have its own version though): https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/drivers/rtc/hctosys.c?id=b3a5ac42ab18b7d1a8f2f072ca0ee76a3b754a43 > If you have ancient user space that doesn't do this, you might still > rely on read_persistent_clock() to set the boot time. > Last time I checked a default debian install on x86 would set the system time 2 times from the kernel and then 2 times from userspace. I'm pretty sure we could do without read_persistent_clock and CONFIG_RTC_HCTOSYS and let userspace handle system time. For example, on ARM, only omap and tegra are defining a read_persistent_clock callback. All the other platforms are just working fine without it. As you pointed out on IRC a while ago, s390 seems to be the only user where this is actually useful. -- Alexandre Belloni, Bootlin (formerly Free Electrons) Embedded Linux and Kernel engineering https://bootlin.com