From patchwork Wed Mar 11 03:24:36 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xunlei Pang X-Patchwork-Id: 45620 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f199.google.com (mail-wi0-f199.google.com [209.85.212.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 46168214BF for ; Wed, 11 Mar 2015 03:29:00 +0000 (UTC) Received: by wivr20 with SMTP id r20sf5066080wiv.0 for ; Tue, 10 Mar 2015 20:28:59 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=2LfdmUrQhaqt91v8Wr20RQh8YdZhNsuSPXk88+MjTVo=; b=eolNhY0MhFYSDPzF9XubEy0g20KofkgINinVovFrPmfTm2S1ZYSZU3z4TEvdK7e8OC iB5U3xRa4jdYwHmwhsmT+c487Pz0XYenYI9i1ao8dX/cOYcmj9ZJwuG5tYiSgClbwMHa /IblFXs3I51U8DOAuHXoQDTX6SaZdFsewZ3f3L95zf2ewOVi6KMR7+2Hki+eZu1hz/ny Csb5E9bZP7zczHlvYHa2QJKuVJMr+uurlffymJciuovFMYSH0zipwzRs4mB7jCdokrcd tiTv6QHS0Wkh61RZNqE82kQmMD9KrQde9+3kkHWnqoK5sGebEQEVykJXB4enF2mM++CF 5Qag== X-Gm-Message-State: ALoCoQkTZmGuegHATzQpU3Ux1LGrpZapMROcUQmqq3q6cXogWx7qD6bcNM+jReXmmEFqceUoUAag X-Received: by 10.180.11.34 with SMTP id n2mr5598415wib.2.1426044539610; Tue, 10 Mar 2015 20:28:59 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.197.34 with SMTP id ir2ls96890lac.84.gmail; Tue, 10 Mar 2015 20:28:59 -0700 (PDT) X-Received: by 10.152.27.232 with SMTP id w8mr28335917lag.51.1426044539284; Tue, 10 Mar 2015 20:28:59 -0700 (PDT) Received: from mail-lb0-x231.google.com (mail-lb0-x231.google.com. [2a00:1450:4010:c04::231]) by mx.google.com with ESMTPS id e7si1488760lag.102.2015.03.10.20.28.59 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 10 Mar 2015 20:28:59 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2a00:1450:4010:c04::231 as permitted sender) client-ip=2a00:1450:4010:c04::231; Received: by lbiw7 with SMTP id w7so6075524lbi.7 for ; Tue, 10 Mar 2015 20:28:59 -0700 (PDT) X-Received: by 10.152.120.134 with SMTP id lc6mr32477005lab.72.1426044539154; Tue, 10 Mar 2015 20:28:59 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.35.133 with SMTP id h5csp2515906lbj; Tue, 10 Mar 2015 20:28:58 -0700 (PDT) X-Received: by 10.66.90.168 with SMTP id bx8mr73569594pab.53.1426044537408; Tue, 10 Mar 2015 20:28:57 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t2si4435948pds.129.2015.03.10.20.28.56; Tue, 10 Mar 2015 20:28:57 -0700 (PDT) Received-SPF: none (google.com: linux-kernel-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753153AbbCKD2v (ORCPT + 28 others); Tue, 10 Mar 2015 23:28:51 -0400 Received: from m15-112.126.com ([220.181.15.112]:43307 "EHLO m15-112.126.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752036AbbCKD1s (ORCPT ); Tue, 10 Mar 2015 23:27:48 -0400 Received: from localhost.localdomain (unknown [210.21.223.3]) by smtp2 (Coremail) with SMTP id DMmowEBpY1t7tf9UtpRwAw--.964S4; Wed, 11 Mar 2015 11:24:54 +0800 (CST) From: Xunlei Pang To: linux-kernel@vger.kernel.org Cc: rtc-linux@googlegroups.com, Thomas Gleixner , Alessandro Zummo , John Stultz , Arnd Bergmann , linux-omap@vger.kernel.org, Tony Lindgren , linux-tegra@vger.kernel.org, Stephen Warren , linux390@de.ibm.com, Martin Schwidefsky , Ralf Baechle , Arnd Bergmann , Xunlei Pang Subject: [PATCH 7/8] s390: time: Provide read_boot_clock64() and read_persistent_clock64() Date: Wed, 11 Mar 2015 11:24:36 +0800 Message-Id: <1426044277-22170-3-git-send-email-xlpang@126.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1426044277-22170-1-git-send-email-xlpang@126.com> References: <1426044277-22170-1-git-send-email-xlpang@126.com> X-CM-TRANSID: DMmowEBpY1t7tf9UtpRwAw--.964S4 X-Coremail-Antispam: 1Uf129KBjvJXoWxur45KF4furW7Gw1fWFW3ZFb_yoW5WFy3pF Wjy3Z8GrWUGa4DZryayws3ur1jkayDKFsrWayku3yrAryIqF1UXrW8Aa4IvrWYyFWku3yF ka4FqrnrX3WDXaUanT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x07jJwIDUUUUU= X-Originating-IP: [210.21.223.3] X-CM-SenderInfo: p0ost0bj6rjloofrz/1tbimga5v1GfVZNGwgAAsW Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Original-Sender: xlpang@126.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2a00:1450:4010:c04::231 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org; dkim=neutral (body hash did not verify) header.i=@; dmarc=fail (p=NONE dis=NONE) header.from=126.com Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , From: Xunlei Pang As part of addressing "y2038 problem" for in-kernel uses, this patch converts read_boot_clock() to read_boot_clock64() and read_persistent_clock() to read_persistent_clock64() using timespec64. Since S390 is a 64bit architecture, also rename some timespec to timespec64 in time.c and the related references. Signed-off-by: Xunlei Pang --- arch/s390/include/asm/timex.h | 4 ++-- arch/s390/kernel/debug.c | 4 ++-- arch/s390/kernel/time.c | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/arch/s390/include/asm/timex.h b/arch/s390/include/asm/timex.h index 98eb2a5..8b08be3 100644 --- a/arch/s390/include/asm/timex.h +++ b/arch/s390/include/asm/timex.h @@ -108,10 +108,10 @@ int get_sync_clock(unsigned long long *clock); void init_cpu_timer(void); unsigned long long monotonic_clock(void); -void tod_to_timeval(__u64, struct timespec *); +void tod_to_timeval(__u64, struct timespec64 *); static inline -void stck_to_timespec(unsigned long long stck, struct timespec *ts) +void stck_to_timespec64(unsigned long long stck, struct timespec64 *ts) { tod_to_timeval(stck - TOD_UNIX_EPOCH, ts); } diff --git a/arch/s390/kernel/debug.c b/arch/s390/kernel/debug.c index c1f21ac..20ff016 100644 --- a/arch/s390/kernel/debug.c +++ b/arch/s390/kernel/debug.c @@ -1457,14 +1457,14 @@ int debug_dflt_header_fn(debug_info_t * id, struct debug_view *view, int area, debug_entry_t * entry, char *out_buf) { - struct timespec time_spec; + struct timespec64 time_spec; char *except_str; unsigned long caller; int rc = 0; unsigned int level; level = entry->id.fields.level; - stck_to_timespec(entry->id.stck, &time_spec); + stck_to_timespec64(entry->id.stck, &time_spec); if (entry->id.fields.exception) except_str = "*"; diff --git a/arch/s390/kernel/time.c b/arch/s390/kernel/time.c index 20660dd..e4df144 100644 --- a/arch/s390/kernel/time.c +++ b/arch/s390/kernel/time.c @@ -76,7 +76,7 @@ unsigned long long monotonic_clock(void) } EXPORT_SYMBOL(monotonic_clock); -void tod_to_timeval(__u64 todval, struct timespec *xt) +void tod_to_timeval(__u64 todval, struct timespec64 *xt) { unsigned long long sec; @@ -181,12 +181,12 @@ static void timing_alert_interrupt(struct ext_code ext_code, static void etr_reset(void); static void stp_reset(void); -void read_persistent_clock(struct timespec *ts) +void read_persistent_clock64(struct timespec64 *ts) { tod_to_timeval(get_tod_clock() - TOD_UNIX_EPOCH, ts); } -void read_boot_clock(struct timespec *ts) +void read_boot_clock64(struct timespec64 *ts) { tod_to_timeval(sched_clock_base_cc - TOD_UNIX_EPOCH, ts); }