Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754019AbdFPOEw (ORCPT ); Fri, 16 Jun 2017 10:04:52 -0400 Received: from mail-wr0-f178.google.com ([209.85.128.178]:34947 "EHLO mail-wr0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753101AbdFPOEu (ORCPT ); Fri, 16 Jun 2017 10:04:50 -0400 From: Benjamin Gaignard To: john.stultz@linaro.org, tglx@linutronix.de, sboyd@codeaurora.org, shuah@kernel.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, Benjamin Gaignard Subject: [PATCH 0/3] rtc: make st-lpc robust against y2038/2106 bug Date: Fri, 16 Jun 2017 16:03:50 +0200 Message-Id: <1497621833-9942-1-git-send-email-benjamin.gaignard@linaro.org> X-Mailer: git-send-email 1.9.1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1230 Lines: 27 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 -- 1.9.1