From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933233AbcASUQ0 (ORCPT ); Tue, 19 Jan 2016 15:16:26 -0500 Received: from smtp02.smtpout.orange.fr ([80.12.242.124]:48663 "EHLO smtp.smtpout.orange.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933184AbcASUQR (ORCPT ); Tue, 19 Jan 2016 15:16:17 -0500 X-ME-Helo: belgarion X-ME-Auth: amFyem1pay5yb2JlcnRAb3JhbmdlLmZy X-ME-Date: Tue, 19 Jan 2016 21:16:13 +0100 X-ME-IP: 109.222.85.94 From: Robert Jarzmik To: Alexandre Belloni , Alessandro Zummo Cc: Rob Herring , rtc-linux@googlegroups.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH] rtc: sa1100: detect rcnr overflow with dates after 2038 References: <1453165031-29194-1-git-send-email-alexandre.belloni@free-electrons.com> X-URL: http://belgarath.falguerolles.org/ Date: Tue, 19 Jan 2016 21:16:11 +0100 In-Reply-To: <1453165031-29194-1-git-send-email-alexandre.belloni@free-electrons.com> (Alexandre Belloni's message of "Tue, 19 Jan 2016 01:57:11 +0100") Message-ID: <87si1tcol0.fsf@belgarion.home> User-Agent: Gnus/5.130008 (Ma Gnus v0.8) Emacs/24.4 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Alexandre Belloni writes: > rcnr will overflow in 2038, detect that overflow when setting the time and > get rid of the deprecated rtc_tm_to_time() > > Signed-off-by: Alexandre Belloni Hi Alexandre, That's very nice, but doesn't that limitation touch almost all drivers, and could benefit from a global solution in rtc_set_time() ? What I'm thinking of is a field in rtc_device, a u64 which represents the maximal time that can be set (or 0 if no maximum). rtc_set_time() would check against that maximum and return -EINVAL. For the rtc drivers, upon registration they can modify this value to set up this clamp. This will require to set only a value in each driver, which looks more robust to me. Alessandro, what do you think ? Cheers. -- Robert