Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp473605ybn; Thu, 3 Oct 2019 07:44:26 -0700 (PDT) X-Google-Smtp-Source: APXvYqwvXM+XrjNLgGxrXHPRzB2ithWKL/0cAPtfqxdubHJQwpXEQPMzjaJxBq0Q+yopGgCN8M6h X-Received: by 2002:a17:906:1853:: with SMTP id w19mr8147189eje.232.1570113866121; Thu, 03 Oct 2019 07:44:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570113866; cv=none; d=google.com; s=arc-20160816; b=O0RQlF1cp30HWKAPYBsB5kJKhp5Ok6Uz1VrZgNWJKwSfn3bpDI8srybEQjYi+VRILd 565DS6ylkgwITvevdBeJZCvJI+KuZeHATK3rEwaq9pXfhhFA7Fv72qSJV8BhMOIcVWxm ZMCpiuea4VPF2dCAzsWpw83P6BuX/pvf0kiIg+FunZ/cvpGcTg4TuSWKeGfKnCca/zHL pV899XXkNbaSHULqLDO5VDmNbBFdECmRUOAncATkPcv4oyGf+CRKKuCcHqcn/xmtqVzc kPL2QMfj+1kzmEFSB6zrUdkXXRV6KCAp401z9u/KKfmtnOqXf3Ia1Uy10+BCJaEfQE5W QEFQ== 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=bboOjrZ7O5ei5Vx7auaJo2KTEFluyt0GOh1OrGI6jwQ=; b=zqafbWdmH0RjvxgB6bFNuQRI43lqAVJIOiW/dGwjIdguDo8Ayjzzirk8sqlWNy/GgX p5NdaU5Lfb3W57lHo70f47s5kC8D1HOsB6hShfN5QHgdIaPNVn5ZgpUOW+Q9pauRSyAY sXuBxeUcfCD93FmR16X1ZhsOBmw/gHz4MCYVJcGwqkseIBhoFk/49ZtIq0oi7bCuDTVA seZdU7FI8Cx1VRbJgpsMUn8GGXuWYhhFtC8BU0ezrxqqj6Q2SfrVHVPStle5h2adH3RN vR9E+e1NpKrNeuYR2/Y4f1Tfl0Z7opGpw5X5TlGHZaNgYy2qMi1J6TlFnT8dQQKdKRvL qesA== 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 lw9si1383762ejb.51.2019.10.03.07.44.01; Thu, 03 Oct 2019 07:44:26 -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 S1728920AbfJCNnc (ORCPT + 99 others); Thu, 3 Oct 2019 09:43:32 -0400 Received: from relay12.mail.gandi.net ([217.70.178.232]:38055 "EHLO relay12.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726119AbfJCNnc (ORCPT ); Thu, 3 Oct 2019 09:43:32 -0400 Received: from localhost (aclermont-ferrand-651-1-259-53.w86-207.abo.wanadoo.fr [86.207.98.53]) (Authenticated sender: alexandre.belloni@bootlin.com) by relay12.mail.gandi.net (Postfix) with ESMTPSA id 58E5420000A; Thu, 3 Oct 2019 13:43:30 +0000 (UTC) Date: Thu, 3 Oct 2019 15:43:29 +0200 From: Alexandre Belloni To: Lukasz Majewski Cc: Alessandro Zummo , linux-rtc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] rtc: Add support for century bits to m41t62 (rv4162) RTC devices Message-ID: <20191003134329.GB575@piout.net> References: <20190911154803.15969-1-lukma@denx.de> <20191003114831.GR4106@piout.net> <20191003142150.3d73a9d7@jawa> <20191003123538.GS4106@piout.net> <20191003151434.49762715@jawa> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191003151434.49762715@jawa> 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 03/10/2019 15:14:34+0200, Lukasz Majewski wrote: > Hi Alexandre, > > > On 03/10/2019 14:21:50+0200, Lukasz Majewski wrote: > > > > > > > > See the datasheet: > > > > > > > > "During any year which is a multiple of 4, the RV-4162 RTC will > > > > automatically insert leap day, February 29. Therefore, the > > > > application software must correct for this during the exception > > > > years (2100, 2200, etc.) as noted above." > > > > > > I'm wondering what the phrase "application software" means here? > > > > > > If it is the userland SW, then we shall at least be able to set > > > 2099 in this device and then count on software correction. > > > > > > If the "application software" is the kernel driver - the date > > > correction shall be done there (maybe some lookup table?). > > > > > > Personally, I do prefer the first option - this means that with this > > > patch we can set the time to e.g. 2234 year and then rely on > > > userland software (or libc) to do the correction. > > > > > > > It is not possible to ensure this correction is properly done in > > software, there is no point in letting the user set those bits. > > > > > > I see your point. > > However, could you share your idea on testing setting RTC time to year > 2100 on this particular IC (by using hctosys and friends)? > You can use rtc from https://git.kernel.org/pub/scm/linux/kernel/git/abelloni/rtc-tools.git/ You can also use rtc-range with your patch to observe that it fails in 2100. -- Alexandre Belloni, Bootlin Embedded Linux and Kernel engineering https://bootlin.com