Received: by 10.192.165.148 with SMTP id m20csp3327031imm; Mon, 23 Apr 2018 04:49:17 -0700 (PDT) X-Google-Smtp-Source: AIpwx48IC628NOVo3XVPaueMRcBevN3tbb3RHMNmTbzI7q8qjzCgEA6/61QRgqbCHUleGJj2wtFP X-Received: by 2002:a17:902:b589:: with SMTP id a9-v6mr8156022pls.351.1524484157002; Mon, 23 Apr 2018 04:49:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524484156; cv=none; d=google.com; s=arc-20160816; b=kCjsN0L0rhxnoNVMN9t6ponmatcNlSt+7VB80it8afQuA89gdMq8LOHKTRorCuvVix B9UChsudEQY30cmZ53Tz62qb1QXHDSN+11dppeplTA7sL7pjUsFnzlS40gjvN3fAOTFK 8bbR2g153n9Wn3LeHWubJDZrd4LLXypVbmRh+AUIAzldsxbSBB59qjEeuDgPoTW4Lp9L bUlT7ATOnI8nu7K7hS2WLBxRaqX4ncIzc59Q9UCQwcgOzb8xXMfE0ryiVJO/7zTPKVpk C0ILMfWiAykxliV9CCWssh8RuyR6BJ5lkBuAYa3QbH9bF2WoVv0NbcTBlc9kYyuf9aEi 8wDw== 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=aDJdE+/kBpXrJv4DwUfOxtIgw80UCfQOE5N024HEhRc=; b=gqlCTKjG4HIh/ZwZfFZPujmRKDUvFry+YOfv5xkxWbExZw4FMNFNsf2K3dgUd8Unq1 UdvhyPg1B9/tQmp9plnK8f4XJRs2JdwNa3yb21lGZaY7cPAYcxLLf1NH/ZSMFBnuHLKM GA/6ddxNsyulMB9OQE+3744nje0PwKivpJFOA19X8r5Qv0SI+kZRMMNwUA2bBr5kCMHN JJWZdAAQE5XjLwrGZ/uWKOFdlvRcKloci28NQHOnloJyQgdAyG0Bd9fm2d5K3PVM+aYH 61cyQ5ElT94eR+JZQo7npvGsdWB1XO9TqZogEUa0/H6lYaWpMFfYj7yArrF/GgNbKPlS p/DQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=auBQFeQw; 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 v1si110612pff.217.2018.04.23.04.49.02; Mon, 23 Apr 2018 04:49:16 -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=auBQFeQw; 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 S1754855AbeDWLrr (ORCPT + 99 others); Mon, 23 Apr 2018 07:47:47 -0400 Received: from mail-qk0-f193.google.com ([209.85.220.193]:36727 "EHLO mail-qk0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754770AbeDWLrn (ORCPT ); Mon, 23 Apr 2018 07:47:43 -0400 Received: by mail-qk0-f193.google.com with SMTP id a202so15809316qkg.3 for ; Mon, 23 Apr 2018 04:47:43 -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=aDJdE+/kBpXrJv4DwUfOxtIgw80UCfQOE5N024HEhRc=; b=auBQFeQwQkCaP4f0z5IvmWAcPMNPGrEk50e3dviRJCpivKnfwIpW+LWnM4YgYBtV/5 fBi7S0OXbzXdL9rk1F/gWFvHMzkav22bzNzRwklaSu9Y8F12TFRpwzcseAHc/BASLuoI V9iG/Rm1JNxjumtXTr5QTqPg90L8hWJicTjb3TuzFYaf6djRXpHsaX8oIsj6AcYi/XFO K4rcjRAnzCdvHYm1ONIPwBQVUvl8w2Zw7q+FgQfBSlx+IzzWfrFk4XAEG49ltXjTn1D3 LcF5EOiyNO8vMn5LVxFTbFTY/yCyaTxFSJ4exd8OTSIpG9ec2kqe9Va5r1XWPe/brSfN f7Qw== 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=aDJdE+/kBpXrJv4DwUfOxtIgw80UCfQOE5N024HEhRc=; b=mpp72+Pnin4TzDBgCJcHIbIlGLbWEPnvAxS76lb5tokxsRuEJmpoZSaRKLytg1xrfq GK4hCgU7G3obClNWvJhVy6pY0cJhCV0Nms3/eUEH4ryQfQMFS3oo7jHq1g23GeFOXfeq q3WeAzksZ4FpRgrA4e2Q6bB7bXc+XTHs8KjhIM6GEVPsBwVgR6AkHttdCx7RuB8fZEyM HzR1p98CFfdaEgVScmpAnN2s6/ztdADR+MrW6KQhSt9ImwMGLX+MNWc0a4ISfVjYfmUG VJbzE9FyWgXTISESSjrDSAPut+0JmO6sMKaRpb3QbUL8glsdDF6y9yFhqc7z6tDT2sCe fuSg== X-Gm-Message-State: ALQs6tCFGz60rT4HIUxXbGGwm89slcTMgjbqWN+1oYj4DA1Zja8G/1uL 0BI7dTKwSt/yrPetWo9kJ/kJgDQvD61U3C3zSRg= X-Received: by 10.55.149.70 with SMTP id x67mr21009882qkd.202.1524484062420; Mon, 23 Apr 2018 04:47:42 -0700 (PDT) MIME-Version: 1.0 Received: by 10.12.185.25 with HTTP; Mon, 23 Apr 2018 04:47:41 -0700 (PDT) In-Reply-To: References: <0ca46228311ec615947e199def9fed62d70c1f07.1524118799.git.baolin.wang@linaro.org> From: Arnd Bergmann Date: Mon, 23 Apr 2018 13:47:41 +0200 X-Google-Sender-Auth: VPtwaGpSL-YcptemjQcWaXuz0UA Message-ID: Subject: Re: [PATCH] m68k: Remove read_persistent_clock() To: Geert Uytterhoeven 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 On Mon, Apr 23, 2018 at 11:47 AM, Geert Uytterhoeven wrote: > 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? Ok, so for the suspend case on m68k, can can totally ignore read_persistent_clock64(): classic doesn't have suspend and coldfire doesn't implement mach_hwclock() callbacks, right? For reference, this is the set of machines implementing mach_hwclk: arch/m68k/68000/m68328.c: mach_hwclk = m68328_hwclk; arch/m68k/68000/m68EZ328.c: mach_hwclk = m68328_hwclk; arch/m68k/68000/m68VZ328.c: mach_hwclk = m68328_hwclk; arch/m68k/apollo/config.c: mach_hwclk = dn_dummy_hwclk; /* */ arch/m68k/atari/config.c: mach_hwclk = atari_tt_hwclk; arch/m68k/atari/config.c: mach_hwclk = atari_mste_hwclk; arch/m68k/bvme6000/config.c: mach_hwclk = bvme6000_hwclk; arch/m68k/hp300/config.c: mach_hwclk = hp300_hwclk; arch/m68k/mac/config.c: mach_hwclk = mac_hwclk; arch/m68k/mvme147/config.c: mach_hwclk = mvme147_hwclk; arch/m68k/mvme16x/config.c: mach_hwclk = mvme16x_hwclk; arch/m68k/q40/config.c: mach_hwclk = q40_hwclk; arch/m68k/sun3/config.c: mach_hwclk = sun3_hwclk; arch/m68k/sun3x/config.c: mach_hwclk = sun3x_hwclk; >> 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. Ok. In that case, a possible cleanup for the old time handling could be to move each of the hwclk implementations over to use their own RTC driver instead of a mach_hwclk function with generic_rtc. It seems that the mach_set_ss and nach_set_mmss callbacks can simply get removed already, they are never called. Similarly, the mach_get_rtc_pll() and mach_get_rtc_pll() callbacks are only used on q40, and could be removed after changing the q40 over to using its own RTC driver, or registering the ioctl operation itself. Arnd