From patchwork Fri Nov 21 19:44:13 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Stultz X-Patchwork-Id: 41359 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ee0-f70.google.com (mail-ee0-f70.google.com [74.125.83.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id D73312452C for ; Fri, 21 Nov 2014 19:44:46 +0000 (UTC) Received: by mail-ee0-f70.google.com with SMTP id b57sf3770895eek.9 for ; Fri, 21 Nov 2014 11:44:46 -0800 (PST) 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=rzGLbyNk9WZT7i8G69XDFcrvzIFJfLIbc7+ZZvry3cI=; b=Q4+ML7VD+zpA1+vnjIOQO5FippSn3GqNw865VNVYLVnODrA9yN0ebWFHVv2FSs+Pgc R/ee5ErItzj0b0nxMc5Qpagt45fTDuA5kew0qblkxqWfOxmbdLhi2a8opqIO4Wy7XFvY XJ3WIHBLIxdLdvXKzFPUyDqKOQv/n5h+Rss7BUxIpYwHllPIXGgc0cnWgkbRHfQuOJ3V 3H7xVVaxIdJzQFPMdB8+rSbHC+erm0fKA8nUEGhxCX3W3VTg5XRuvS7Z9pXY/yrlucS8 9fe369sqigJYGhxoriF2o3V469adwje28mctI/+MSbtZ/C/aUTeluRVLAW7bjOuPA43G S7vg== X-Gm-Message-State: ALoCoQkYtxS4F604mPCx3d/sq2c89xS8l+uGHA12WERs3TiI8WxD9tjHq4CU+XiTINohHvSg0Cz+ X-Received: by 10.152.10.233 with SMTP id l9mr2121081lab.0.1416599086081; Fri, 21 Nov 2014 11:44:46 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.170.165 with SMTP id an5ls247743lac.92.gmail; Fri, 21 Nov 2014 11:44:45 -0800 (PST) X-Received: by 10.152.23.103 with SMTP id l7mr6229185laf.92.1416599085537; Fri, 21 Nov 2014 11:44:45 -0800 (PST) Received: from mail-lb0-f177.google.com (mail-lb0-f177.google.com. [209.85.217.177]) by mx.google.com with ESMTPS id ai9si7059128lbc.55.2014.11.21.11.44.45 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 21 Nov 2014 11:44:45 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.177 as permitted sender) client-ip=209.85.217.177; Received: by mail-lb0-f177.google.com with SMTP id 10so1776650lbg.22 for ; Fri, 21 Nov 2014 11:44:45 -0800 (PST) X-Received: by 10.152.6.228 with SMTP id e4mr7242210laa.71.1416599085443; Fri, 21 Nov 2014 11:44:45 -0800 (PST) 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.184.201 with SMTP id ew9csp153740lbc; Fri, 21 Nov 2014 11:44:44 -0800 (PST) X-Received: by 10.70.64.134 with SMTP id o6mr9913774pds.153.1416599083192; Fri, 21 Nov 2014 11:44:43 -0800 (PST) Received: from mail-pa0-f51.google.com (mail-pa0-f51.google.com. [209.85.220.51]) by mx.google.com with ESMTPS id rw5si10566148pac.32.2014.11.21.11.44.42 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 21 Nov 2014 11:44:43 -0800 (PST) Received-SPF: pass (google.com: domain of john.stultz@linaro.org designates 209.85.220.51 as permitted sender) client-ip=209.85.220.51; Received: by mail-pa0-f51.google.com with SMTP id ey11so5553644pad.10 for ; Fri, 21 Nov 2014 11:44:42 -0800 (PST) X-Received: by 10.66.119.175 with SMTP id kv15mr10728027pab.30.1416599082494; Fri, 21 Nov 2014 11:44:42 -0800 (PST) Received: from localhost.localdomain (c-67-170-153-23.hsd1.or.comcast.net. [67.170.153.23]) by mx.google.com with ESMTPSA id t9sm5513621pbs.75.2014.11.21.11.44.41 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 21 Nov 2014 11:44:41 -0800 (PST) From: John Stultz To: lkml Cc: John Stultz , Thomas Gleixner , Ingo Molnar , Arnd Bergmann , "pang.xunlei" , Miroslav Lichvar , Richard Cochran , Prarit Bhargava , Alessandro Zummo Subject: [PATCH 07/12] time: Expose getrawmonotonic64 for in-kernel uses Date: Fri, 21 Nov 2014 11:44:13 -0800 Message-Id: <1416599058-13836-8-git-send-email-john.stultz@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1416599058-13836-1-git-send-email-john.stultz@linaro.org> References: <1416599058-13836-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.217.177 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: , Adds a timespec64 based getrawmonotonic64() implementation that can be used as we convert internal users of getrawmonotonic away from using timespecs. Cc: Thomas Gleixner Cc: Ingo Molnar Cc: Arnd Bergmann Cc: pang.xunlei Cc: Miroslav Lichvar Cc: Richard Cochran Cc: Prarit Bhargava Cc: Alessandro Zummo Signed-off-by: John Stultz --- include/linux/timekeeping.h | 15 ++++++++++++++- kernel/time/timekeeping.c | 11 ++++++----- 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/include/linux/timekeeping.h b/include/linux/timekeeping.h index 6d76c65..e40a8d6 100644 --- a/include/linux/timekeeping.h +++ b/include/linux/timekeeping.h @@ -26,7 +26,7 @@ struct timespec __current_kernel_time(void); * timespec based interfaces */ struct timespec get_monotonic_coarse(void); -extern void getrawmonotonic(struct timespec *ts); +extern void getrawmonotonic64(struct timespec64 *ts); extern void ktime_get_ts64(struct timespec64 *ts); extern int __getnstimeofday64(struct timespec64 *tv); @@ -61,6 +61,11 @@ static inline void ktime_get_real_ts(struct timespec *ts) getnstimeofday64(ts); } +static inline void getrawmonotonic(struct timespec *ts) +{ + getrawmonotonic64(ts); +} + #else /** * Deprecated. Use do_settimeofday64(). @@ -105,6 +110,14 @@ static inline void ktime_get_real_ts(struct timespec *ts) getnstimeofday64(&ts64); *ts = timespec64_to_timespec(ts64); } + +static inline void getrawmonotonic(struct timespec *ts) +{ + struct timespec64 ts64; + + getrawmonotonic64(&ts64); + *ts = timespec64_to_timespec(ts64); +} #endif extern void getboottime(struct timespec *ts); diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c index d37f775..b329586 100644 --- a/kernel/time/timekeeping.c +++ b/kernel/time/timekeeping.c @@ -894,12 +894,12 @@ int timekeeping_notify(struct clocksource *clock) } /** - * getrawmonotonic - Returns the raw monotonic time in a timespec - * @ts: pointer to the timespec to be set + * getrawmonotonic64 - Returns the raw monotonic time in a timespec + * @ts: pointer to the timespec64 to be set * * Returns the raw monotonic time (completely un-modified by ntp) */ -void getrawmonotonic(struct timespec *ts) +void getrawmonotonic64(struct timespec64 *ts) { struct timekeeper *tk = &tk_core.timekeeper; struct timespec64 ts64; @@ -914,9 +914,10 @@ void getrawmonotonic(struct timespec *ts) } while (read_seqcount_retry(&tk_core.seq, seq)); timespec64_add_ns(&ts64, nsecs); - *ts = timespec64_to_timespec(ts64); + *ts = ts64; } -EXPORT_SYMBOL(getrawmonotonic); +EXPORT_SYMBOL(getrawmonotonic64); + /** * timekeeping_valid_for_hres - Check if timekeeping is suitable for hres