Received: by 2002:a17:90a:37e8:0:0:0:0 with SMTP id v95csp251788pjb; Thu, 3 Oct 2019 05:36:17 -0700 (PDT) X-Google-Smtp-Source: APXvYqz1uBD9hot2Mwisa+iE9LkE1Vo8c1wGsfCGiklx1FOMoZ3ewCLC9STMcDliPnYkRwN+19dG X-Received: by 2002:a50:ed82:: with SMTP id h2mr9283922edr.206.1570106177495; Thu, 03 Oct 2019 05:36:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570106177; cv=none; d=google.com; s=arc-20160816; b=qH8TYNd/9K1Vk4B4eu80CL0+7Jbf5sd4lm2OcN3aVeG5RIM0/q26cZYfUBIqrEpgz5 NQPwSNh369x6E0+708KrQzyGHgOE9QgR7ymDmuWF12zSXu61BT0LkXSRTSZlMVKHVdJk ujE4lliRZ7J40uPW9nubECD4OZ6V/GxbO05EIGFjh8qcJqNBOugaAEY0IqhdPi0fDpfg 3gWueld+OvFCi15X7mZlBDwizrboSrXfVrbcbyGrrSz7vYHkPPtxIW9qD/ErKdc31KQJ vmNwqamLi17Tsu0xYGJkwi6DT6N8tzT+Ev52lFOF71vJ7WuoC1Bx4+/W3Y9dokpZL22I ow2g== 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=+n3xKdWDTgkuPaHkoehM9PvuR5azWgoOppztFZ66vqA=; b=tWI2WN7AnJoHHJRZZJewIyS1rH48krSU5wkq/oBeBSEU/yRYGiUA7Fg/RqVPXNZz7m Spi+MyB35ZpXnQ+yKjyvOxu7h3ohCKEjkNb5Arytzh8LbS35GdKF/VotrqyrHCC18wjL PO9I3dhpuw7JQskDpuxGRL9y/ZJP3cKsA5MnTOLv0Xb1Mm44XSigHfQYCJ1catX9t95c x66epHZ2RkI2OAo89WWb53thpFDhzb+t51m+gNTfXuMRO/lMT5a73+HSn4WyFqqCDnhs sLxTGnSKH1jj+A3NvyYLjBZn2EbnRDRm0Dvk6q30md6y69Q5N8iQRm3++GAU9v0xD2wp zjYA== 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 f14si1247180edf.102.2019.10.03.05.35.52; Thu, 03 Oct 2019 05:36: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 S1729319AbfJCMfl (ORCPT + 99 others); Thu, 3 Oct 2019 08:35:41 -0400 Received: from relay8-d.mail.gandi.net ([217.70.183.201]:54013 "EHLO relay8-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727242AbfJCMfl (ORCPT ); Thu, 3 Oct 2019 08:35:41 -0400 X-Originating-IP: 86.207.98.53 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 relay8-d.mail.gandi.net (Postfix) with ESMTPSA id 452081BF211; Thu, 3 Oct 2019 12:35:39 +0000 (UTC) Date: Thu, 3 Oct 2019 14:35:38 +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: <20191003123538.GS4106@piout.net> References: <20190911154803.15969-1-lukma@denx.de> <20191003114831.GR4106@piout.net> <20191003142150.3d73a9d7@jawa> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191003142150.3d73a9d7@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 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. -- Alexandre Belloni, Bootlin Embedded Linux and Kernel engineering https://bootlin.com