Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753105AbdFPPTK (ORCPT ); Fri, 16 Jun 2017 11:19:10 -0400 Received: from resqmta-po-05v.sys.comcast.net ([96.114.154.164]:49416 "EHLO resqmta-po-05v.sys.comcast.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753037AbdFPPTJ (ORCPT ); Fri, 16 Jun 2017 11:19:09 -0400 Reply-To: shuah@kernel.org Subject: Re: [PATCH 0/3] rtc: make st-lpc robust against y2038/2106 bug To: Benjamin Gaignard , john.stultz@linaro.org, tglx@linutronix.de, sboyd@codeaurora.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, patrice.chotard@st.com, a.zummo@towertech.it, alexandre.belloni@free-electrons.com, linux-arm-kernel@lists.infradead.org, rtc-linux@googlegroups.com Cc: linaro-kernel@lists.linaro.org, Shuah Khan References: <1497621833-9942-1-git-send-email-benjamin.gaignard@linaro.org> From: Shuah Khan Message-ID: Date: Fri, 16 Jun 2017 09:19:06 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.1.1 MIME-Version: 1.0 In-Reply-To: <1497621833-9942-1-git-send-email-benjamin.gaignard@linaro.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-CMAE-Envelope: MS4wfAbivxxCwAzhUmNTpDeUnLYtraraHAV4U35cQZa8Y6vdAUcQt24gggudrnpCBu9PRAJPnyH1G/4mnFUCm6yY+AbrhMKfBAcM8fVJdEXicssrqbZsKtpg EnbDo6kpmMRb7lRjGmom5VXv+rqJv41MS8l/mamiHr46dWJTvEEC8JOLhFKeXUmdtUc/D7nYNcdrxowV4c07NJEgHJpQ6ZgKANdX83Y39iJ0CKZ1qzJff8i0 u4hYFGX9mGHR83TuHsHr0zUakFS4Hnssnb/mMOSkaW06QhQ5qkwppJIby5tNRwI4sykiALahjgdU25bq2uI0ITL7TPHcjxapxH+PU54MlAVxFs67g2OMgvdu lzkIZehMJriqd9QP4Bj2zUy03dGsdYiuIKi2SmOWnY4xehuLUliTuW5ppvS5+IbMv5qwMmwihAkCAmQIWW7o651mCMuORCLPjwDai9DUv9qdvs7HmOq+8R3x EUyd4XNvxRkOTg+dL337evd9kfPcN5fd4E3DwtFEVYAaa5c92+0DYvLbolJEd2CRLYUSLg8Mm5GDZUhIb0JJs6OnWEsHDuKdcI8813dTInSzkhopuFIAiPnP 2Tly2nupcsxd14PEbaxt/haPhcSDUwfPyPc7KdrNpQDIbp1zswarAR1PmxNl93Ij5FU= Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1465 Lines: 34 On 06/16/2017 08:03 AM, Benjamin Gaignard wrote: > On 32bits platforms "struct timeval" or "time_t" are using u32 to code the > date, this cause tools like "date" or "hwclock" failed even before setting > the RTC device if the date is superior to year 2038 (or 2106). > > To avoid this problem I add two RTC tests files which directly use RTC ioctl > to set and read RTC time and alarm values. > rtctest_setdate allow to set any date/time given in the command line. > rtctest-2038 perform a basic test by writing 1-1-2200 in RTC time and alarm > and checking that the read back values are correct. > > Finally that had allowed me to test and fix rtc-st-lpc driver. > > Benjamin Gaignard (3): > tools: timer: add rtctest_setdate > tools: timer: add test to check y2038/2106 bug > rtc: st-lpc: make it robust against y2038/2106 bug > > drivers/rtc/rtc-st-lpc.c | 19 ++-- > tools/testing/selftests/timers/Makefile | 4 +- > tools/testing/selftests/timers/rtctest-2038.c | 135 +++++++++++++++++++++++ > tools/testing/selftests/timers/rtctest_setdate.c | 86 +++++++++++++++ > 4 files changed, 232 insertions(+), 12 deletions(-) > create mode 100644 tools/testing/selftests/timers/rtctest-2038.c > create mode 100644 tools/testing/selftests/timers/rtctest_setdate.c > Hi John/Thomas, Please review them and let me know. Looks to me these will make good additions to 4.13-rc1 kselftest content. thanks, -- Shuah