From patchwork Wed May 20 17:19:35 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Stultz X-Patchwork-Id: 48816 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f71.google.com (mail-la0-f71.google.com [209.85.215.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id E566F21411 for ; Wed, 20 May 2015 17:20:10 +0000 (UTC) Received: by laat2 with SMTP id t2sf19727834laa.2 for ; Wed, 20 May 2015 10:20:09 -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:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=/URKvBPIrFlZ177Qo4achJPxj3a9xan4KTFhVrpU524=; b=PmtNHl/zWBoB4AnZMn+z60tgc+n08KFWmvrnXXzw8K/HV7kIJd63u6JvlowyQW4Oix r/lm4Oq2ExzvofHTGZ/OYw8BGmFQ9NfgIxep/yMboCc2oQNpxOy6tVbjdxehbjd6qYxp yNsUr87lpy2oZ5Lf2X1kkEdz1N/iKPb9Gv2lo6q7gaGzLYjjdkrEFXHDaCcjJCt+xE7Z 5nwXhu6pLWZDQfi1fY4R45iRYlC3KVBVkCkRmLoRbMUtuA1UC/3M159evKpBlYl8cI9H KrLArGPtL7p1KdwQcJtg7OIgZaZFefCnDV1OD3pNAaJ6a3iRifsAsGT7gXXXovosfq0/ a71g== X-Gm-Message-State: ALoCoQlTYt9Cek/cidHp/d/IktVaHnRK4AbTZB7i0q0pXBcsQpHSNbHxLV3jrKH96kk+1BRqhVIz X-Received: by 10.180.106.136 with SMTP id gu8mr19412522wib.6.1432142409912; Wed, 20 May 2015 10:20:09 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.178.195 with SMTP id da3ls228978lac.43.gmail; Wed, 20 May 2015 10:20:09 -0700 (PDT) X-Received: by 10.112.72.132 with SMTP id d4mr26691588lbv.1.1432142409673; Wed, 20 May 2015 10:20:09 -0700 (PDT) Received: from mail-la0-f44.google.com (mail-la0-f44.google.com. [209.85.215.44]) by mx.google.com with ESMTPS id p5si11526404laj.137.2015.05.20.10.20.09 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 20 May 2015 10:20:09 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.44 as permitted sender) client-ip=209.85.215.44; Received: by laat2 with SMTP id t2so83858353laa.1 for ; Wed, 20 May 2015 10:20:09 -0700 (PDT) X-Received: by 10.152.4.72 with SMTP id i8mr94766lai.32.1432142409432; Wed, 20 May 2015 10:20:09 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.112.108.230 with SMTP id hn6csp1678642lbb; Wed, 20 May 2015 10:20:08 -0700 (PDT) X-Received: by 10.68.69.79 with SMTP id c15mr28781534pbu.25.1432142397786; Wed, 20 May 2015 10:19:57 -0700 (PDT) Received: from mail-pd0-f176.google.com (mail-pd0-f176.google.com. [209.85.192.176]) by mx.google.com with ESMTPS id gs10si27408913pac.124.2015.05.20.10.19.56 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 20 May 2015 10:19:57 -0700 (PDT) Received-SPF: pass (google.com: domain of john.stultz@linaro.org designates 209.85.192.176 as permitted sender) client-ip=209.85.192.176; Received: by pdfh10 with SMTP id h10so75891505pdf.3 for ; Wed, 20 May 2015 10:19:56 -0700 (PDT) X-Received: by 10.70.43.176 with SMTP id x16mr65062398pdl.83.1432142396827; Wed, 20 May 2015 10:19:56 -0700 (PDT) Received: from localhost.localdomain (c-67-170-153-23.hsd1.or.comcast.net. [67.170.153.23]) by mx.google.com with ESMTPSA id fp3sm16745952pdb.52.2015.05.20.10.19.55 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 20 May 2015 10:19:55 -0700 (PDT) From: John Stultz To: LKML Cc: Xunlei Pang , Thomas Gleixner , Ingo Molnar , Martin Schwidefsky , Heiko Carstens , linux390@de.ibm.com, John Stultz Subject: [PATCH 6/7] s390: time: Provide read_boot_clock64() and read_persistent_clock64() Date: Wed, 20 May 2015 10:19:35 -0700 Message-Id: <1432142376-2077-7-git-send-email-john.stultz@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1432142376-2077-1-git-send-email-john.stultz@linaro.org> References: <1432142376-2077-1-git-send-email-john.stultz@linaro.org> X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: john.stultz@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.44 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: 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. Cc: Thomas Gleixner Cc: Ingo Molnar Cc: Martin Schwidefsky Cc: Heiko Carstens Cc: linux390@de.ibm.com Signed-off-by: Xunlei Pang Signed-off-by: John Stultz --- 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); }