Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp958822pxb; Thu, 21 Oct 2021 12:50:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzYw2sALjwU2dZH+kou10FkKAF1dbyLiq4g/PVcor3henCw7WwhvJZtDzoU7n+AydlhB9fD X-Received: by 2002:a17:90b:1b4f:: with SMTP id nv15mr9327923pjb.78.1634845856129; Thu, 21 Oct 2021 12:50:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634845856; cv=none; d=google.com; s=arc-20160816; b=AmcmUpsPkER1MxdDOgyZeOzYI0N1M5dD16e/8DJfojB9VaARQPVrQngDFx3Bn58+7Y zvkd6FrfRKdIONnD1qBDBhA0IwBui8Vdwh+LzyF+QtUNK3YZa/+dNmYUqG7Go5B1QIKE zQd7KXpuZn8rvWrjaFQ1gO25hfs6MmD0kzd8SKKjRenh06FjcyT3fwhwkNI+8eCTxgBs jZwLyE15VM1+4F3OA8npTWP21xcZjpHODZQViToyorZ8xJRnO8RZwU7dwN6caFog+SzE O74Zy+mHqxc9sJzVVNDpaYiBgwuxPE6zKwqGYT+2+914LmiKvOqC7OiIDEeE7bqVcZlA EBQQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=506SnosJu2/k7veB5Auol9VGHyPyzo6ab/OrxVZJdFc=; b=wzDmQZpP5eMx+E0eh77eZ8mL8d3T/MeMF4hquQxUpPd/4yj/0VNPpKBBAyMa2RDwcf G4BqxFcKxry2JODVie1sIpGQcaOrymAsR7zOKmJvjQD3FtIRQ43BMiIeJ79iDigDeeQZ Cwi7zoiUTRjCNmqKoI7QbQsSrnYu/Xg0Q/lVPLYmVZ3zqB9fvBffJ0p6G7SisqYuDq3U l+Rmp20lmE5KXUYJLTGQW3xoUdCM3UqpzK2jsxRtplgSdaEsMSEM7iPIh6pGal8LX765 MEddHVO2YOn+1BxeWjnHJ0ZWzE608V7tKO+tdWJIkCThZ2AHh6Fxk5urWHfcEaiC1kB+ Ah2Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=JZeRQvhO; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q20si9088399plk.29.2021.10.21.12.50.39; Thu, 21 Oct 2021 12:50:56 -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; dkim=pass header.i=@linaro.org header.s=google header.b=JZeRQvhO; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231579AbhJUTvW (ORCPT + 99 others); Thu, 21 Oct 2021 15:51:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57366 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230272AbhJUTvU (ORCPT ); Thu, 21 Oct 2021 15:51:20 -0400 Received: from mail-ua1-x929.google.com (mail-ua1-x929.google.com [IPv6:2607:f8b0:4864:20::929]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4B537C061348 for ; Thu, 21 Oct 2021 12:49:04 -0700 (PDT) Received: by mail-ua1-x929.google.com with SMTP id h19so3421207uax.5 for ; Thu, 21 Oct 2021 12:49:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=506SnosJu2/k7veB5Auol9VGHyPyzo6ab/OrxVZJdFc=; b=JZeRQvhOimryHQTO0F1yK8ihzbC/IVWHgTOcrfhaJ1QgKmHtIb9FPtaoXxJXzLCepk 0pc0gLbmtclOHyfWODXsmlN0T/zcv+5Bid66yCjZR28gKB4+ecuHtN+zZYfLpiQuJypb 9snbIJAmr2/89bUHVp+jINBxclOHw0uCjGV8hXoYu/MEazJ7bOsVUAMnALH5OlFviYEx EOgXtMlWXrRf4q/CdZB4mSS9IOTXNfbvKgn4RNtkCrTX8r0IIt9fPmtZ49UhMB5w6LZj wo2Nh0mBp0rHAznuCL6fMlVRUFPWy3vlVYZHk5I9FPTPwZKWbwjYfB5VzZTdfTfXiEi9 X1bQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=506SnosJu2/k7veB5Auol9VGHyPyzo6ab/OrxVZJdFc=; b=WqGKGTRi9xsqFg8GAdQVhQ/G31Q0kfUiyR20epZMy8NCHBlZxE/5vAw/t8SQxcimZU IRoJ4kUOrIW3+Nm3P/KcdxTtKw6D3S+ht2v8YIfXKfM3S0lpEZ2W7n1CPxb54VV031ue TDiZVuVf7pIcH6zsGO1+Oa1HyQaHIu8YSv+tvw9EudLWd8NKYe5wQtskAFtsllrN3o0m 6aMdAMpkxdRoAKnfI0xlELnKyJToFM6byJOIWyEwZn7ziYIS2xXVRxUvf41w3MB9fvdE dUtw0W9hxinmEInZxAUcxFzuBmwzvgMDB/dqnFvSJNftq7LVjBdyXJ9MLxhemNpId2eK 7ACg== X-Gm-Message-State: AOAM532/CJ3JMDHXpsnNIo0HfLWBEOiA3XW/rnsAMcfx39ISmwFbjJyI VVnjXuGeZ2MuYTghP6/YClo4BdR0MMCvNgfslwaDUsGjNxxOvR0r X-Received: by 2002:a67:d91b:: with SMTP id t27mr9275555vsj.55.1634845743358; Thu, 21 Oct 2021 12:49:03 -0700 (PDT) MIME-Version: 1.0 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> In-Reply-To: From: Sam Protsenko Date: Thu, 21 Oct 2021 22:48:51 +0300 Message-ID: Subject: Re: [PATCH 2/4] rtc: s3c: Add time range To: Krzysztof Kozlowski , Alexandre Belloni Cc: Alessandro Zummo , linux-rtc@vger.kernel.org, Linux Samsung SOC , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 20 Oct 2021 at 09:29, Krzysztof Kozlowski wrote: > > On 19/10/2021 21:12, Sam Protsenko wrote: > > 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. > > > > I think all S3C chips have only 8-bit wide year, so 2000-2099, while > S5Pv210 and Exynos has 12-bit (1000 years). However I doubt there is big > benefit of supporting more than 2100. :) If you still want, you would > need to create the patch carefully because not many people can test it... > Guys, After testing thoroughly, I can confirm that Alexandre is right about leap years (Exynos850 RTC treats both 2000 and 2100 as leap years). And it also overflows internally on 2159 year, limiting the actual time range at 160 years. So I'll keep that range at 100 years for all RTCs. As Krzysztof said, there is no practical reasons in trying to increase it anyway. Will send v2 soon. What I'm curious about is RTC testing. I've found this test suite: tools/testing/selftests/rtc/rtctest.c But it doesn't seem to cover corner cases (like checking leap years, which was discussed here). Just a thought: maybe it should be added there, so everyone can benefit from that? For example, I know that in Linaro we are running LKFT tests for different boards, so that might theoretically reveal some bugs. Though I understand possible implications: we probably don't know which ranges are supported in driver that's being tested. Anyway, just saying. > > Best regards, > Krzysztof