Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp833135pxb; Tue, 19 Oct 2021 14:07:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxK/q81jvHFbj/ZjeCgj1Rn/QX+b36DhpUKGxWTVto7xc2xcpdLU9AjNzw2HgpL5xbWXR2q X-Received: by 2002:a17:906:1381:: with SMTP id f1mr40069891ejc.547.1634677621640; Tue, 19 Oct 2021 14:07:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634677621; cv=none; d=google.com; s=arc-20160816; b=lpzSECFQ4NtD0yu0f/QTAkrzGD+bA+tnUYE6LW/G2d6OPagmgNtAP9JObstbS+mvs9 nPfltd7WGQ0GMUg7NTsSMQO9H36Sj0W0FeHZKu+3LGB/VIyqH2IwwSSxwvdVEBFDuBeb +NhmPFSalS5dwI5XpNUjTBthm9dn+ZbAimScC1UXE/g3YFlNOGoAdgnyZI98HzS2/irX cqqRT60TWl5AzMNDtXiYCMdxnFgJ76weVxdhTlvQ0S87eQyuK0lCJFX7WFUusAwDCaH0 lVD+bHCao5bD7segpGJXToyBLQqZracWvjMX+uzujUbtrkqSRhmMKvNePGSR80uUjWGK aVbw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=qanyP8tSSHArE+Z0FJf6NInxvasjTBd48s4Zce4SKaU=; b=h9yACmCuQ4CT6A8wG4leLhM71Izz4DDo6ZvWwhvrOMmxTvZ9CebraRSLH9HixyfG5n o0cU7L5xjsbuD5eiPsbBlNeLfVgYcRxVtIjjzX9MSbgskD24kZGl2dPlYQrS1075/q+W RlGlv593sHdUIDLtgz0jcYv2yvwzB877Kzk/8MgieQrQ6WTHVU7YIbc+YxaEYmOejGSY YEEqDcA6ovvM7ShK7ryAkJIO9C54TGGRLHQ7q2q6lvNsOrinsqRaNIgQheJIjWMBO1Hn ygXmOn9iZO1tb2BX/y2NjkUOjabfTAldSeqYaO9btsBETxHjvOl0vYRiXCmXEbRYRu9e YGng== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i16si288154edc.553.2021.10.19.14.06.37; Tue, 19 Oct 2021 14:07:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234424AbhJSVHD (ORCPT + 99 others); Tue, 19 Oct 2021 17:07:03 -0400 Received: from relay7-d.mail.gandi.net ([217.70.183.200]:41619 "EHLO relay7-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231506AbhJSVHC (ORCPT ); Tue, 19 Oct 2021 17:07:02 -0400 Received: (Authenticated sender: alexandre.belloni@bootlin.com) by relay7-d.mail.gandi.net (Postfix) with ESMTPSA id 6316D20002; Tue, 19 Oct 2021 21:04:47 +0000 (UTC) Date: Tue, 19 Oct 2021 23:04:47 +0200 From: Alexandre Belloni To: Sam Protsenko Cc: Krzysztof Kozlowski , Alessandro Zummo , linux-rtc@vger.kernel.org, Linux Samsung SOC , Linux Kernel Mailing List Subject: Re: [PATCH 2/4] rtc: s3c: Add time range Message-ID: References: <20211019131724.3109-1-semen.protsenko@linaro.org> <20211019131724.3109-3-semen.protsenko@linaro.org> <6dbd4812-bac3-55dc-108e-c322e8a493de@canonical.com> <6ce55971-bee5-1bc9-c3a2-28e6ede37401@canonical.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 19/10/2021 22:12:09+0300, Sam Protsenko wrote: > > It would be better to pass the proper values because else nobody will > > ever come back and fix it (hence why I didn't move that driver to > > devm_rtc_register_device yet). > > > > Krzysztof, do you have by chance the doc for different SoCs supported > by S3C RTC driver? I can implement proper values for min/max range for > each SoC, as Alexandre asked, by adding those to driver data. But I > need max year register value (100, 1000, etc) for each of those chips: > > - "samsung,s3c2410-rtc" > - "samsung,s3c2416-rtc" > - "samsung,s3c2443-rtc" > - "samsung,s3c6410-rtc" > - "samsung,exynos3250-rtc" > > For example Exynos850 TRM states that BCDYEAR register has [11:0] bits > for holding the year value in BCD format, so it's 10^(12/4)=1000 years > max. > And the question will be whether time is contiguous over this period. A very common thing is that the RTC will think that years divisible by 100 are not leap years, even if the register accepts higher values. This makes it work for 2000 but fails in 2100. -- Alexandre Belloni, co-owner and COO, Bootlin Embedded Linux and Kernel engineering https://bootlin.com