From patchwork Mon Jun 19 09:36:19 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Gaignard X-Patchwork-Id: 105810 Delivered-To: patch@linaro.org Received: by 10.140.91.2 with SMTP id y2csp786829qgd; Mon, 19 Jun 2017 02:37:15 -0700 (PDT) X-Received: by 10.98.94.134 with SMTP id s128mr23590167pfb.43.1497865035855; Mon, 19 Jun 2017 02:37:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1497865035; cv=none; d=google.com; s=arc-20160816; b=YBv0Hw47elRyMwWfEnOGe2jocJ2StWUTi1Cww47H9JTKv+BDwOl7ZtlC1R/NVnzTDY qSqAPR1xLkLHZyooowJUkJYXHjS8V4NOghejujKoS7Sr7+yvZFMIMJKHn/beoIG2Nn0Q cSs7RA5MA9N6OGz/wTBcigIBnpe6lQwsLk/mjrBvw3ZZI86pjJ1RbV2s2dYygoYRVP39 EAB/AcuLjJEND72TUc8UJcViGrzCuMQvAVIvMnO89en7xCsZUk3gVw7UJH2ugjOoiphD tdhzipqlokzDlK0EvqlXz1kf0LzPzHzgsiF55warfL+jAlGEMxd+LOTJqH5b5qY2wbAk D2qw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=NjHzjsziOn1vbgEhXcIx6goso0qzH1P0/GGWDHSe71A=; b=MbzC6/ExcWbYxK4l3ZlNggJnVGB70O0BjZRjmiTmx81ruHF/RXK0yG5+i+HEsJJef+ Z7RxzNdDLeOw9pIUD2PaKzsuwmKBodSPAUJlx1JduoSgaHFOb1LJH30J7ITl4KcYtjOV d9ZczQoqWQKobPDL+p+RmoZpod2P3jt1IsMwFD+WPaos1RQyZrpvzPDCDhTrxP1LVkYB bo5Ah4lA6iQ5mfJKCRWqAobULhbMhcToBYABF0cxRPpIoHJT30yyi8ASyUx8Rs0XXOak qbS+EWpKchagFvgZDqZZA40mOTytDucKswXCQA+6H6OGcXkxL59wL077Iiurt6J8w2Wz 7BQw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.b=PqS2wDlm; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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. [209.132.180.67]) by mx.google.com with ESMTP id b24si6937568pfh.9.2017.06.19.02.37.15; Mon, 19 Jun 2017 02:37:15 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.b=PqS2wDlm; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 S1753900AbdFSJg5 (ORCPT + 25 others); Mon, 19 Jun 2017 05:36:57 -0400 Received: from mail-wr0-f175.google.com ([209.85.128.175]:33427 "EHLO mail-wr0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753696AbdFSJgz (ORCPT ); Mon, 19 Jun 2017 05:36:55 -0400 Received: by mail-wr0-f175.google.com with SMTP id r103so68594647wrb.0 for ; Mon, 19 Jun 2017 02:36:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=NjHzjsziOn1vbgEhXcIx6goso0qzH1P0/GGWDHSe71A=; b=PqS2wDlmltaFDDPAlI4TaOAa87JDLqVUfp8ZSxPvvS9FZn5znxrUmAq6IGi6ouEf8H A42OPoS4hxxGHEcGQuTmMZE/UIc8ZYzm9Pd/M+Wt9PxFNzh1x8pV8IIhyF02WeiMeA8O e+HyGYuA+gTINTQCCVBmmm36kVcmGHK8/xBBs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=NjHzjsziOn1vbgEhXcIx6goso0qzH1P0/GGWDHSe71A=; b=t55550nbcSHrBW9ux8qRDOpkji1OWxeHNJOypu3kcRQk2ehLprQR5Vz/jEIXQT6qBX gmsLdVCSniLHf9ydV/K8q7O02iIJFnPyWVhKjsH8Cj73wx50e9JTtrk6gccO+aqaiBqN gVeqdqZOKJxWTp5hnSoZp2yLtwkCBpAIuk7S1s0blluceMmkMruumpm9+mbOUafsHAho 9lJIA3KsIc9dWwbzwC4vhA8J+ZHwVPrpk7/XvRea5w8UxOTNPBnsyFHjhyODqFT+uIKa iw3j8p9VSDzkD9SlG7yOI+E3CuKg6KOe3BCLlc4Tiw9ha4c6ExKczriQ7PM1IIGL7Nxc dDrA== X-Gm-Message-State: AKS2vOylkmUl1Byyx9Q3P828rPyHYG2spa9nBOmkhPBHOSl7zUqWEA7p 047z5ac7SfJYF212 X-Received: by 10.223.136.135 with SMTP id f7mr11755782wrf.148.1497865014251; Mon, 19 Jun 2017 02:36:54 -0700 (PDT) Received: from lmenx321.st.com. ([80.215.35.135]) by smtp.gmail.com with ESMTPSA id y2sm11037024wme.12.2017.06.19.02.36.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 19 Jun 2017 02:36:52 -0700 (PDT) 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 v2 0/3] rtc: make st-lpc robust against y2038/2106 bug Date: Mon, 19 Jun 2017 11:36:19 +0200 Message-Id: <1497864982-29284-1-git-send-email-benjamin.gaignard@linaro.org> X-Mailer: git-send-email 1.9.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 one RTC test file 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. On this version 2 I add check of problematics years in rtctest like suggest by Alexandre. Finally that had allowed me to test and fix rtc-st-lpc driver. Benjamin Gaignard (3): tools: timer: add rtctest_setdate tool: timer: rtctest add check for problematic dates rtc: st-lpc: make it robust against y2038/2106 bug drivers/rtc/rtc-st-lpc.c | 19 ++-- tools/testing/selftests/timers/Makefile | 2 +- tools/testing/selftests/timers/rtctest.c | 121 ++++++++++++++++++++++- tools/testing/selftests/timers/rtctest_setdate.c | 86 ++++++++++++++++ 4 files changed, 212 insertions(+), 16 deletions(-) create mode 100644 tools/testing/selftests/timers/rtctest_setdate.c -- 1.9.1