Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp754595pxb; Tue, 19 Oct 2021 12:15:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy2x0u4K/Udhriv9fBO/uMz5zDISf9M17awHi9/MR8YjMS7K1aIhezQqgmztavtW7rmfyKR X-Received: by 2002:a17:907:628f:: with SMTP id nd15mr15590180ejc.389.1634670948818; Tue, 19 Oct 2021 12:15:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634670948; cv=none; d=google.com; s=arc-20160816; b=dzTLgjJGWDBSgMxoFcEM628RRCWEnySAIabbrWPc55uOVOGocjmsEkiqratjb+2TfA wCGERRePLmXfXDO7R+3XHS4vj+AEPVg7BBRUdtqQt1fFIkNqOKNmC13/FH4AdzpQGT6J /2uC9k1wGG9BuZthheTxzGPyM2MFQRotbbs3tNotiRvugt9T5cO+Cck4NFY/emZFOlPg LxkXWl7TKeyhsC0hObU7t8h84OJDyX2Urf/1c2RzVhPtteAuga3OyUPnugoBsbYREFzu M4MAICkRN5yDPopEQqtEN3tDD7lIx8Gg0KyQvOTBBv92p7igcrQE/60v9TozdM7Lf88L mOGg== 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=Paa52ALECI3wUgugNy8CX4++EAERrhUzLClLzz2TeNo=; b=u7ElczjkobxQfNBW4UnbNYC2ONJodYTxk/IaG+rBz4fg/7YoE7nkfJS+m1455/gdul 3dt2yNG58vlZzPKmPT74qFYmckp+Gs6lXLQ5KEs78sADJYEz/eedoS3XLAUGVoXMREss n3zuc4bc/LrO59zsAc0OMbO9FHM8j2As2NvRHD5/RU4Lhy5jbCYIYBj11oW/2v2Vivr3 5lngXWOs0nQClNaadlGsrdzrmdqd+HemB66NzYT5YIufI1RwtCXiEnt/XWgFZ/xBhFJm h9lypO0WYhQlzzUyicgID0hH5M7NSTJbI9NnK7Q+ZxndoLkP0+3rdWg5lkV8/w3eVFns amUQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=hh3mY9mb; 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 t14si29570110edd.142.2021.10.19.12.15.21; Tue, 19 Oct 2021 12:15:48 -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=hh3mY9mb; 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 S234715AbhJSTOh (ORCPT + 99 others); Tue, 19 Oct 2021 15:14:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45640 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234361AbhJSTOf (ORCPT ); Tue, 19 Oct 2021 15:14:35 -0400 Received: from mail-vk1-xa30.google.com (mail-vk1-xa30.google.com [IPv6:2607:f8b0:4864:20::a30]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 53615C061749 for ; Tue, 19 Oct 2021 12:12:22 -0700 (PDT) Received: by mail-vk1-xa30.google.com with SMTP id i6so5494824vkk.5 for ; Tue, 19 Oct 2021 12:12:22 -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=Paa52ALECI3wUgugNy8CX4++EAERrhUzLClLzz2TeNo=; b=hh3mY9mbnyhpcdRWYDvhD2yUXHW8hgFnt3kUIWZ22dBTVZ+gi5IeJ1qesyZWkqPzwN +aOQNt9Pgi6oky9KfgTvuPgk5JWQdaxqMet37tg+BFtstHZJOtpuJqQWjL1lY6AdRFEC aeBQDsDVpVUUIwXdfjti+9Kl1dzW1Vxx7ZfNScNF7jKmK5GOA45gwI8FTRYBJkY9TJ/e cROr8c6AbzibsRO18sfK5ZOrbUK8RkYkyM4Iu69q4pIbwOkHZXhhOYPbWdaCMUN3SjfB /gSXNEQst1CrUPrDAkiuTLxmD3F9lmMZ/K84fGgncj9TQPGEgEZsRkDDR953i3rZ2mlc R/xQ== 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=Paa52ALECI3wUgugNy8CX4++EAERrhUzLClLzz2TeNo=; b=cyFbOWRP+GSB4TVWHKQH1YCL96ff0YDRqOTBS6iurHt2zh8L5wNouhQFWo2h90wlW/ cZygB4WLuSzSNui9sUZTgHeIqwRbaNDpUL6vXIElnoJVTcWSkzLHmasZAHV4sQ0AYr+L sNqnMc99nfYZHJR67IkrIsuEl6ZGpDyi1CFoQcqLVNqKAhyY6mIy4R/8MnSC4qfg0PFy tdhXSR/nJo+ZXoRaxgKPBmFtWykLkUSzRTegPXcJDp8XHkI+inPho6GVzZmUAJ1frw2m jGJ22PvX7NUvCJ7zH47dOMTOnY1a1PtJ4ynNwR3FgMUYIkvcq8Yo3cfUSBS/YNztiavj qwEw== X-Gm-Message-State: AOAM53154mGpoogbCyMJ1/72WoOqUKntQMk9nhOzBOAEuSOLkQLJqH46 56c1npnUBsEJPUlMTK4kDyo+091xkclmCAh10nlVSQ== X-Received: by 2002:a05:6122:da0:: with SMTP id bc32mr34368591vkb.4.1634670741090; Tue, 19 Oct 2021 12:12:21 -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: Tue, 19 Oct 2021 22:12:09 +0300 Message-ID: Subject: Re: [PATCH 2/4] rtc: s3c: Add time range To: Krzysztof Kozlowski Cc: Alessandro Zummo , linux-rtc@vger.kernel.org, Linux Samsung SOC , Linux Kernel Mailing List , Alexandre Belloni Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 19 Oct 2021 at 20:48, Alexandre Belloni wrote: > > On 19/10/2021 19:35:26+0300, Sam Protsenko wrote: > > On Tue, 19 Oct 2021 at 19:22, Krzysztof Kozlowski > > wrote: > > > > > > On 19/10/2021 18:17, Krzysztof Kozlowski wrote: > > > > On 19/10/2021 15:17, Sam Protsenko wrote: > > > >> This RTC driver only accepts dates from 2000 to 2099 year. It starts > > > >> counting from 2000 to avoid Y2K problem, > > > > > > > > 1. Where is the minimum (2000) year set in the RTC driver? > > > > > > Ah, indeed. I found it now in the driver. > > > > > > > > > > >> and S3C RTC only supports 100 > > > > > > > > On some of the devices 100, on some 1000, therefore, no. This does not > > > > look correct. > > > > > > That part of sentence is still incorrect, but change itself makes sense. > > > Driver does not support <2000. > > > > > > > Driver itself does not allow setting year >= 2100: > > > > <<<<<<<<<<<<<<<<<<<< cut here >>>>>>>>>>>>>>>>>>> > > if (year < 0 || year >= 100) { > > dev_err(dev, "rtc only supports 100 years\n"); > > return -EINVAL; > > } > > <<<<<<<<<<<<<<<<<<<< cut here >>>>>>>>>>>>>>>>>>> > > > > Devices might allow it, so the commit message phrasing is incorrect > > and should be replaced, yes. But the code should be correct. Should I > > send v2 with fixed commit message? > > > > 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. > -- > Alexandre Belloni, co-owner and COO, Bootlin > Embedded Linux and Kernel engineering > https://bootlin.com