Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp484701ybn; Thu, 3 Oct 2019 07:54:18 -0700 (PDT) X-Google-Smtp-Source: APXvYqxq4ZUYfvzx8DQ3buQHkRug1QsB7jfLLkb0lk6dPqisb6UHnvNsUShJ5JzKCD4UEUCWBY44 X-Received: by 2002:a17:906:1f89:: with SMTP id t9mr7917850ejr.241.1570114458008; Thu, 03 Oct 2019 07:54:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570114458; cv=none; d=google.com; s=arc-20160816; b=EU3vyXgjCbow1u1fTk5L+Nueigui5BfBYrLTZ34+ecRtOgFTSwsf16/DUukwedZeoP JrB9MluH7wwiYTjCKyQ38Fu9w09lDM2KG8yjTmY4BBAKygis03lXbkmUOvJO1BQa1Ii0 UDTjBa7VDMavNVrq5EJd1gOJD2fzZeFhbl9wvIOaCme0QTvropw0C7rLmfr8eJ+55j9r tOW5gdbgFVpbstmRxtDzLyqiOfmU/+e/NbIHU615sAX/2tiuw5SWLIiwCVo6rJRMODmq zfcduD1GeQvRgkOWGGqTgzUhCuqEF02rhF/o0hVy+1vkHtAVSaN5giBd41mNym2noabm yfoQ== 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=++M+sY5MLWDtIFRogtOhdOOSVp+35qBahBq+oQdJMJY=; b=Nc0eBRR4aQ+2WyHsiBRe79ZhxlKxmE+BncHqFjPP0x4wEM5fQrMaXA445D8CuW/TrN WxsPuZ4SEP3RB4hBYthNqeewgzuL3eTd9wAO3FKaMtgN0WGbMuXH5Jc3XgwL7WiF+16S CXNBQurgLqWdrOB8+4ypsB8rcGpl6Wc251+PHXIGwZ69BknOJsNoFot3IcKFfNTRX5A7 DFeH6f0KbuL1+G5rBhQ+khYyM11cqi8wqbvPgYKJGyWq+UHzzCWE/7XqojJpIZWVBdya 1rt9MVfwHINkk1SqOHJ2jxa7+KpLuF8FLIAifAdPhGclP8qK7EVQqq4IdqhFABsZPR9Q v8UQ== 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 e2si1578474edv.369.2019.10.03.07.53.53; Thu, 03 Oct 2019 07:54:17 -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 S1729651AbfJCOXo (ORCPT + 99 others); Thu, 3 Oct 2019 10:23:44 -0400 Received: from relay10.mail.gandi.net ([217.70.178.230]:47973 "EHLO relay10.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725957AbfJCOXo (ORCPT ); Thu, 3 Oct 2019 10:23:44 -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 relay10.mail.gandi.net (Postfix) with ESMTPSA id 1DB0A240022; Thu, 3 Oct 2019 14:23:41 +0000 (UTC) Date: Thu, 3 Oct 2019 16:23:41 +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: <20191003142341.GD575@piout.net> References: <20190911154803.15969-1-lukma@denx.de> <20191003114831.GR4106@piout.net> <20191003142150.3d73a9d7@jawa> <20191003123538.GS4106@piout.net> <20191003151434.49762715@jawa> <20191003134329.GB575@piout.net> <20191003161054.1eeae401@jawa> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191003161054.1eeae401@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 16:10:53+0200, Lukasz Majewski wrote: > Sorry, but I do see some inconsistency here. > > The application note [1] says that the correction shall be done in > application SW. > > The rtc-range.c program [2] sets and reads the time via ioctl (e.g. > RTC_SET_TIME, RTC_RD_TIME). > > To pass your tests one needs to do the correction in linux kernel > driver for drivers/rtc/rtc-m41t80.c. > > Please correct me if I'm wrong, but IMHO it shall be enough to adjust > 2100, 2200, 2300, years in this driver (the submitted patch shall be > adjusted to support it - I can prepare proper v2). > There is no way you will be able to know when to adjust the date because Linux may or may not be running when the boundary is crossed. The only useful range for an RTC is its fully contiguous range. If it needs software to run to support an extended range, it can't be used in the context of Linux. -- Alexandre Belloni, Bootlin Embedded Linux and Kernel engineering https://bootlin.com