From patchwork Thu Apr 9 01:04:41 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xunlei Pang X-Patchwork-Id: 46898 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f69.google.com (mail-la0-f69.google.com [209.85.215.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 4CC8320D10 for ; Thu, 9 Apr 2015 01:07:23 +0000 (UTC) Received: by labgx2 with SMTP id gx2sf23543704lab.1 for ; Wed, 08 Apr 2015 18:07:22 -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=dAu+Buj8OcPJRMdF7nprO0aMMUgAKyWo1WMKvvK/pLg=; b=TnCKFsvIMolOeOAD/U2YEgNo6KM1s4tnBmJFoCIvZk/79vd/g81qStOcTRnM7YhKvX 0uf2+7T0pUFJNPVaK6jHh4JgAI+E00mcYuyS/GQ+xglOoa4+J/wsu6Frl3m5m3bPqr2b M+B4gsjv1HmxKXKex8735N4cUaJncMqPy4b04qIr7eDwMOr4GIOK933absHg4ejhSiQP vxU+DhFHdyVNC1AMVCd6XlWVLP0NEar68e51SC0+uy/qNGd4nL4b8mlIyc2bl6A2XFgA /3/zMdp7aZqKcKIvqS1kXlZNU8aZ1Ps8L6qkiI9AJGeAiMsRmCbbFw1t7+/69xkifrXS BTPg== X-Gm-Message-State: ALoCoQkHiiPnSVEIYxDohrR/n5tYYayL4aP88Dc29pdJNmi1NuuPEdc1JjW+9hqFdiD3mHfD0BBb X-Received: by 10.180.83.41 with SMTP id n9mr143787wiy.4.1428541642269; Wed, 08 Apr 2015 18:07:22 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.164.230 with SMTP id yt6ls262375lab.39.gmail; Wed, 08 Apr 2015 18:07:21 -0700 (PDT) X-Received: by 10.112.198.225 with SMTP id jf1mr219363lbc.91.1428541641868; Wed, 08 Apr 2015 18:07:21 -0700 (PDT) Received: from mail-lb0-x230.google.com (mail-lb0-x230.google.com. [2a00:1450:4010:c04::230]) by mx.google.com with ESMTPS id pq6si10132719lbc.137.2015.04.08.18.07.21 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 08 Apr 2015 18:07:21 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2a00:1450:4010:c04::230 as permitted sender) client-ip=2a00:1450:4010:c04::230; Received: by lbbzk7 with SMTP id zk7so79955904lbb.0 for ; Wed, 08 Apr 2015 18:07:21 -0700 (PDT) X-Received: by 10.152.116.11 with SMTP id js11mr2102913lab.106.1428541641741; Wed, 08 Apr 2015 18:07:21 -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.67.65 with SMTP id l1csp176855lbt; Wed, 8 Apr 2015 18:07:20 -0700 (PDT) X-Received: by 10.68.248.129 with SMTP id ym1mr49999674pbc.101.1428541639902; Wed, 08 Apr 2015 18:07:19 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h13si18993883pdl.3.2015.04.08.18.07.16; Wed, 08 Apr 2015 18:07:19 -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 S932458AbbDIBHN (ORCPT + 27 others); Wed, 8 Apr 2015 21:07:13 -0400 Received: from m50-110.126.com ([123.125.50.110]:51258 "EHLO m50-110.126.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932372AbbDIBHJ (ORCPT ); Wed, 8 Apr 2015 21:07:09 -0400 Received: from localhost.localdomain (unknown [210.21.223.3]) by smtp4 (Coremail) with SMTP id jdKowAAHDPQu0CVVDnXtAA--.11469S3; Thu, 09 Apr 2015 09:04:53 +0800 (CST) From: Xunlei Pang To: linux-kernel@vger.kernel.org Cc: John Stultz , Arnd Bergmann , Thomas Gleixner , Martin Schwidefsky , Heiko Carstens , linux390@de.ibm.com, Xunlei Pang Subject: [PATCH 2/3] s390: time: Provide read_boot_clock64() and read_persistent_clock64() Date: Thu, 9 Apr 2015 09:04:41 +0800 Message-Id: <1428541482-3181-2-git-send-email-xlpang@126.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1428541482-3181-1-git-send-email-xlpang@126.com> References: <1428541482-3181-1-git-send-email-xlpang@126.com> X-CM-TRANSID: jdKowAAHDPQu0CVVDnXtAA--.11469S3 X-Coremail-Antispam: 1Uf129KBjvJXoWxur45KF4furW7XrWUXF18Xwb_yoWrJry3pF 42y3Z8Wr48Ga4DZryayws3Zr1Y9as8KF43Xas7u3yrAryIqF1UXrW8Aa4IyrWjyF4ku3yF ka40qrnrXa1UXaUanT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x07jy2NtUUUUU= X-Originating-IP: [210.21.223.3] X-CM-SenderInfo: p0ost0bj6rjloofrz/1tbimhTWv1GfV0PPtgAAsE 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::230 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. Rename some timespec to timespec64 in time.c and related references. Signed-off-by: Xunlei Pang --- We've already had read_boot_clock64() in timekeeping, now provide read_boot_clock64() for S390. arch/s390/include/asm/timex.h | 5 +++-- arch/s390/kernel/debug.c | 11 ++++++----- arch/s390/kernel/time.c | 6 +++--- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/arch/s390/include/asm/timex.h b/arch/s390/include/asm/timex.h index 98eb2a5..f39220f 100644 --- a/arch/s390/include/asm/timex.h +++ b/arch/s390/include/asm/timex.h @@ -10,6 +10,7 @@ #define _ASM_S390_TIMEX_H #include +#include /* The value of the TOD clock for 1.1.1970. */ #define TOD_UNIX_EPOCH 0x7d91048bca000000ULL @@ -108,10 +109,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..4f2d11d 100644 --- a/arch/s390/kernel/debug.c +++ b/arch/s390/kernel/debug.c @@ -1457,23 +1457,24 @@ 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 = "*"; else except_str = "-"; caller = ((unsigned long) entry->caller) & PSW_ADDR_INSN; - rc += sprintf(out_buf, "%02i %011lu:%06lu %1u %1s %02i %p ", - area, time_spec.tv_sec, time_spec.tv_nsec / 1000, level, - except_str, entry->id.fields.cpuid, (void *) caller); + rc += sprintf(out_buf, "%02i %011lld:%06lu %1u %1s %02i %p ", + area, (long long) time_spec.tv_sec, + time_spec.tv_nsec / 1000, level, except_str, + entry->id.fields.cpuid, (void *) caller); return rc; } EXPORT_SYMBOL(debug_dflt_header_fn); diff --git a/arch/s390/kernel/time.c b/arch/s390/kernel/time.c index 170ddd2..9e733d9 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); }