Received: by 10.192.165.148 with SMTP id m20csp3207920imm; Mon, 23 Apr 2018 02:30:39 -0700 (PDT) X-Google-Smtp-Source: AIpwx480S+I3vncXwIZLVM04tSVQ1LQm01WwHECr+peL7ka6D+vpDSlFKcfQOM7cRELG+u7P95b9 X-Received: by 2002:a17:902:6689:: with SMTP id e9-v6mr20465107plk.176.1524475839653; Mon, 23 Apr 2018 02:30:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524475839; cv=none; d=google.com; s=arc-20160816; b=hsoxRYCMyaYGhowgPpReQ/dowaJfS330S4n0guM8ghxrTSNkM9fB6e1W0PBy5Xsvgi PANWPny3ywI2CtMjCLljoAQEZitRyWtaBa61Jpqm+NgHO0fgcP4y0Gqdqr5nxjsbHkwZ 8TX1QGeCtS2CCFoacLMd6Z4E2/t8x0IxVd7GwWkdq+arjfLHkwA/+gJGJEoVKwc3464G sCZj7o0VtSJv7zfjxNIU4A/V5AbUzmDO8qwOPdaALMQA5kMi8/HtL7NJ/i2hr7RHCMzd jC+1PVv0qyvj4/L75i4n71MMwA3SOjGyB7jw9BivLe2mOwmdFiQa9fuxXlYuCJpByWQO ntVA== 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=baGibLmINv2sE8nqrftHGMPJQZEuwmyaEazrfZHNSxQ=; b=n7OE7gAH80biYkspl/HyYw1MmcX5My7Y3gyazO2xdgKWJDH0TTqstSMChvk3yJM9YT D5fIFw6Z0dJOgkXMHgzTaxZd0QXSMDD/1tdAsKQZNjsUHFmzxo1aTH1C+h8/WZ081fzC J2EXppHWrk7ltp4+bbU+qeeT+PS1z1Dgi2+SkRyWb7Dcq30PEgcC1zWRxhc6oowunK9G o6U9CIHeKFGLK8Bm7fEYriYO25LVD8RMUMi39/h04EJ54zYbd7Stu3HKDGp7xdWfu9Je Dl5s+HruFQnVo3SVvWwVOxsmmXquG6X9IamkfBKw8o4XT8nSFBmUkz3x/tyVi8JHsHYi Y1sw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=B7vuQO4x; 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 p8-v6si11894161plr.311.2018.04.23.02.30.25; Mon, 23 Apr 2018 02:30:39 -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=B7vuQO4x; 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 S1754680AbeDWJ2o (ORCPT + 99 others); Mon, 23 Apr 2018 05:28:44 -0400 Received: from mail-qk0-f195.google.com ([209.85.220.195]:41237 "EHLO mail-qk0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754401AbeDWJ2j (ORCPT ); Mon, 23 Apr 2018 05:28:39 -0400 Received: by mail-qk0-f195.google.com with SMTP id s78so15433658qkl.8 for ; Mon, 23 Apr 2018 02:28:39 -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=baGibLmINv2sE8nqrftHGMPJQZEuwmyaEazrfZHNSxQ=; b=B7vuQO4xWBlLaMxRMMhVfaVLwklvqm2QhwmLFf4GqqEcOSlFp0rvQ/cl9TvQZC+Odb DcOGR7RTzKX/BzJfscJ13gCBhXWNunJFd5Tt/wcARx3HudIOIp0DvOUPm/7fYxDsx/8B nMkBh3EYxYiWaTqecSqIyvJMMlZz2KlaDpHB4EJzGcYlgR8479gsIOPlUTDNEU+5wca3 XKFT1RnexTYAi9IHQSKkxiqPx+EfPT4i1j1k9T+NjBl3BnYuRveU4Dqv/Gt82ahRr1v4 YtyMU8rqhoX9g2YPt1bV3NeZzzdeDDh+wvKLDJhXuyf0N9UAbmXwNdo1QpXxRXuo25i5 BViw== 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=baGibLmINv2sE8nqrftHGMPJQZEuwmyaEazrfZHNSxQ=; b=qqfmC7dCQ39LAIgI309Rpms4QzN1T5dukpOg9zZbIWpHvz7RZAznWCe8VL5XNT5/55 EhNFs1vzSY4cJOIJMJxRO0qpav+8Sm1UaBaKZjZ/Ll3p8MI7bUBchiwRO/qs81hFWjgK Mgc8Aj12936vcIYkbvdqp+8spxkuBK5msSRcMR3BjsVhcHxMh+rtBoRmF1kuQ5EPMMp8 466tEyWBfnQUruVR97cl8czDtbJ8SREP5Hr2R3KkEKDWJa/yo9dnnx/mK9DnfPX29mdp tA5BLoyHGFfqaIBaX8wnWSSOtvglnCXvENZ5ca0GsGMRMj5vaMOIkZqDL0pq7TPEUTh5 sRFA== X-Gm-Message-State: ALQs6tDRqP0gHows5OO+iaBYr7xsAZOXZh2Ol7Lp7vQ3/6Q+Aq0K/Ym8 vKqlB7wAc2QyAidM5Qy6uHGTaz4mdkHMZ8kZblQ= X-Received: by 10.55.96.5 with SMTP id u5mr11361899qkb.32.1524475718938; Mon, 23 Apr 2018 02:28:38 -0700 (PDT) MIME-Version: 1.0 Received: by 10.12.185.25 with HTTP; Mon, 23 Apr 2018 02:28:38 -0700 (PDT) In-Reply-To: References: <0ca46228311ec615947e199def9fed62d70c1f07.1524118799.git.baolin.wang@linaro.org> From: Arnd Bergmann Date: Mon, 23 Apr 2018 11:28:38 +0200 X-Google-Sender-Auth: V1lZrzUxIWLHK-TECC4-UKLpQK0 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:07 AM, Geert Uytterhoeven wrote: > Hi Arnd, > > 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. 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. > 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). >> 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. Arnd