Received: by 10.192.165.148 with SMTP id m20csp3221835imm; Mon, 23 Apr 2018 02:49:03 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+Pbjl+vMtkuLPWXi5GEG7RDxLHX94kkjrzh5KijTr2O2Z4rkqdALFozlFIYeJSZ0Ks/pFl X-Received: by 10.99.111.129 with SMTP id k123mr16703569pgc.115.1524476943132; Mon, 23 Apr 2018 02:49:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524476943; cv=none; d=google.com; s=arc-20160816; b=avssgAcDtqN0w7SV2UCOLklHVAGXbX97i+nhRg0dQPPHhEaJiTmD69QGlUH6Motdam jmuBM9cTq5HSvt8Qa1RNj0H5UUiqumpDW7jXHMig4PgnM4Xjzpt211DGrFv0vXJJcsXr O909HlKaADuxVi8k1mLhDHQtMyH6Vzka/K1L/6DhpKyxrtAU3Az6n82LI8z0veEF7fNd TKlK8JrM5T7oAXE+oriYoSTTets+PklWE5tG7CkJugXofPa3ex4SvRShm4HnrQ4m6u30 6hquv+qrvKypMN6YCthTE9SCBB1r7Qt6OsTtZfuBLyfSO2xZX+XmJLzvt43jODRyRJMa OmVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=R3xmZNUAdanHKvsd6F1VnC1zaFNI4tskGcVeektv0eg=; b=eOJ4ZF5ilLU6VClVWQrjQWgkOL5O7GSVWsFKALLWPiB45D2XaOVQOEg4Z6zyJ6lNei VQT62k0uZaO1l3wEY9EH1fENcyM/wshiKQxrcTS8AwaUA6U3X1mL1dSeka23tsfUI5lr /X/LWdBbnwU26+4b0x6I4z1VlvKy4LbwhJsiDgDCusp2X2LlwyYXFdiSkL9gnzz3I9sd vFX3UdCmlhAlzAR9ISEsX2U35Ca72XdlrQy3eX0ZbtSLP7zTLLbRDuKTf8p9rWru2vAI qWXLx2bG8uMZS0Qo50VnaCbljIb53WCwBO6La96SFQg3WsUdFHl5v7uusG5w54GQSXzF K+Vg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=hKUpdGbt; 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 g15-v6si12267202pln.526.2018.04.23.02.48.48; Mon, 23 Apr 2018 02:49:03 -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; dkim=fail header.i=@gmail.com header.s=20161025 header.b=hKUpdGbt; 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 S1754539AbeDWJrj (ORCPT + 99 others); Mon, 23 Apr 2018 05:47:39 -0400 Received: from mail-ua0-f195.google.com ([209.85.217.195]:42442 "EHLO mail-ua0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754237AbeDWJrh (ORCPT ); Mon, 23 Apr 2018 05:47:37 -0400 Received: by mail-ua0-f195.google.com with SMTP id f3so4217204uan.9 for ; Mon, 23 Apr 2018 02:47:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=R3xmZNUAdanHKvsd6F1VnC1zaFNI4tskGcVeektv0eg=; b=hKUpdGbtUlf8YbeTw+b2myTqrj8PpJRyKJj1ujcdjnSGjrMAEBJ7buhpkmWvjwH8Hc ZU6+0Jfjniw95aFI5de/ij2Z3jbuCZbdqOpyTL2Lee1G6QRzpTeNQD/GDFYL8/G2rm3k DrDFRShqSfzFRvfzDUDqhiTYn3gzIL5xhxv2fH7Zf011szDOj3mBX7mJHh4GN8CTsAuc BicMBTyLEKIfC/BvMrPT6axKt3VhCn97vk8UbRLEb0tbHiv6twJoXyRs/HdkwSSBbu0+ 4OY/zTxoH1CT+fue+czi3C+TsgvRd2Yql9/BuUYvXmsupuk4xVqYgYPOhl2sqvoUIx8D Sq+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=R3xmZNUAdanHKvsd6F1VnC1zaFNI4tskGcVeektv0eg=; b=Br53zI/QLjxFf3NsBwd9B8h7NAiJIN7HqaJ3Hksbf5GiQIk4jE4qJFePOklJfAfhkz dThvp2JDH/JEvkhTau6jklMxAksYC3eHGB+xkCQW+9DXdV/Iwf4k8O8F++1iraC/M5gp o7ZOg3XOtzYlOHQXq8aVIf+XDf6uLP68ZyZu9LlEfhaKf7JkAFKF5H0NuUKyEyxYsI1l r1ehtrGnW+BGCbg1IXy7jZDSCyIFaKsPlklQJO57XZAGqkopjHCDQYuDw+2vmR0eyUJK PuILCVsIpLJG1G/3LvdwLbv7iXZKfNaBihxuOxK8SyDgiP3Zgf/ap+K2nIlDBnYGBTJ/ AX2g== X-Gm-Message-State: ALQs6tDZJw7sknPaxEHp80SKkVigC1qHD9H8W99G0szFh7DXVQh/XuRb knaSMUzc7qtGjdMieiGvJ0HiQFi0Y8olZVVTvvc= X-Received: by 10.159.53.141 with SMTP id t13mr12787852uad.26.1524476856146; Mon, 23 Apr 2018 02:47:36 -0700 (PDT) MIME-Version: 1.0 Received: by 10.103.122.68 with HTTP; Mon, 23 Apr 2018 02:47:35 -0700 (PDT) In-Reply-To: References: <0ca46228311ec615947e199def9fed62d70c1f07.1524118799.git.baolin.wang@linaro.org> From: Geert Uytterhoeven Date: Mon, 23 Apr 2018 11:47:35 +0200 X-Google-Sender-Auth: nNpK81SmGOnqLgj0nNgtCH-sp68 Message-ID: Subject: Re: [PATCH] m68k: Remove read_persistent_clock() To: Arnd Bergmann Cc: Baolin Wang , Alexandre Belloni , Mark Brown , linux-m68k , Linux Kernel Mailing List , Linus Walleij , Finn Thain Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Arnd, On Mon, Apr 23, 2018 at 11:28 AM, Arnd Bergmann wrote: > On Mon, Apr 23, 2018 at 11:07 AM, Geert Uytterhoeven > wrote: >> On Fri, Apr 20, 2018 at 5:22 PM, Arnd Bergmann wrote: >>> On Thu, Apr 19, 2018 at 8:22 AM, Baolin Wang wrote: >>>> The read_persistent_clock() uses a timespec, which is not year 2038 safe >>>> on 32bit systems. Moreover on m68k architecture, we have implemented generic >>>> RTC drivers that can be used to compensate the system suspend time. So >>>> we can remove the obsolete read_persistent_clock(). >>>> >>>> Signed-off-by: Baolin Wang >>> >>> I'm not sure about this one: it's still possible to turn off >>> CONFIG_RTC_DRV_GENERIC >>> on M68KCLASSIC, and in that case we still need a read_persistent_clock64() >>> implementation. Or we use your patch but make CONFIG_RTC_DRV_GENERIC >>> mandatory. >> >> Typically (in the defconfigs) CONFIG_RTC_DRV_GENERIC is either "m", >> or not set. >> >> And in both cases, a platform-specific RTC class driver may or may not be >> builtin or loaded. We have them for some Amigas (RTC_DRV_MSM6242 or >> RTC_DRV_RP5C01). >> >> I've never been an expert of timekeeping code... > > 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. M68k-with-MMU[*] does not support suspend/resume. [*] Probably the PM dependency should be updated for Coldfire with MMU? > 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. > > If you have ancient user space that doesn't do this, you might still > rely on read_persistent_clock() to set the boot time. Yeah, we have some ancient userspace (old ramdisk from just after the a.out to ELF switch ;-), which worked fine last time I tried ;-) But this should not be considered a dependency, as most people will run e.g. Debian/ports, which I assume is a modern userspace. >> Should we get rid of ARCH_USES_GETTIMEOFFSET? >> it seems m68k and two ARM platforms are the last users. >> What needs to be done? > > This is entirely unrelated, but generally speaking it would be > great to convert m68k away from ARCH_USES_GETTIMEOFFSET, > yes. > > The first step would be to get rid of all the dummy gettimeoffset() functions > that return a constant (like dn_gettimeoffset()). > > The larger part of that effort would be to turn each clock implementation > in m68k into a real clocksource driver. This is probably straightforward, > but I don't know the details (adding LinusW to Cc, he's done this on > some ARM hardware in the past). OK, more work to do... >>> See below for a version I did a while ago (but never submitted as I got >>> distracted). >> >> Thanks, I can apply it, if it is deemed correct ;-) > > Please apply Finn's bugfix for the month-off bug first, that one is more > urgent. I've rebased my patch on top of his and resent that one. Sure. Will do. Thanks! Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds