From patchwork Fri Nov 21 19:44:14 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Stultz X-Patchwork-Id: 41360 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ee0-f69.google.com (mail-ee0-f69.google.com [74.125.83.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 76B512452C for ; Fri, 21 Nov 2014 19:44:48 +0000 (UTC) Received: by mail-ee0-f69.google.com with SMTP id d49sf3457038eek.4 for ; Fri, 21 Nov 2014 11:44:47 -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=5Jb5m7F6wJThCfGL0Sm6Ibr8gKkDJSjRbTBOtXtX2eY=; b=QCegxi2eOPv0plrhgyMbcMhzf2PUnTEc6fyLNs6ddQcF8nQse57LSFHSpW7jf1qrGF ZlRNO81wM60Q86WsO4NK3ogrI0M0GrileiUdibwPXWJ1jdzN8rHr7y3PsIw7RhNaGurT Pz838Pfq/YR0EnMUkGCTWlDmCV0RqPM13Fjw53+G/kccAwcd8dFULU5BqVaDquKpoEhf dCZ5t8zdr9al3Ql4H9ZKKh1BRfgeIAe0dfp6VB8EaRF5wxzwq9fatkPpYY5C78fSsdhe ijx1TIK87dA1pjqwmA10IkJ39Qrp8jnVvW8GFlRLjnrA8tDFF0q8Nmtnd28Q4zFxmhfK jikw== X-Gm-Message-State: ALoCoQmUMMgdvR6Umey4A0aY1sm6mBtO3ohlFWCCazwv6dJR+boe49Wmp49ut3B761bFcCiXy1Zh X-Received: by 10.152.42.196 with SMTP id q4mr2111688lal.6.1416599087680; Fri, 21 Nov 2014 11:44:47 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.23.130 with SMTP id m2ls238256laf.63.gmail; Fri, 21 Nov 2014 11:44:47 -0800 (PST) X-Received: by 10.152.204.9 with SMTP id ku9mr7250129lac.55.1416599087022; Fri, 21 Nov 2014 11:44:47 -0800 (PST) Received: from mail-lb0-f175.google.com (mail-lb0-f175.google.com. [209.85.217.175]) by mx.google.com with ESMTPS id ef4si7062826lac.51.2014.11.21.11.44.46 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 21 Nov 2014 11:44:46 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.175 as permitted sender) client-ip=209.85.217.175; Received: by mail-lb0-f175.google.com with SMTP id u10so1790332lbd.34 for ; Fri, 21 Nov 2014 11:44:46 -0800 (PST) X-Received: by 10.152.87.100 with SMTP id w4mr7133820laz.27.1416599086668; Fri, 21 Nov 2014 11:44:46 -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 ew9csp153743lbc; Fri, 21 Nov 2014 11:44:45 -0800 (PST) X-Received: by 10.68.135.65 with SMTP id pq1mr10530940pbb.18.1416599084487; Fri, 21 Nov 2014 11:44:44 -0800 (PST) Received: from mail-pa0-f46.google.com (mail-pa0-f46.google.com. [209.85.220.46]) by mx.google.com with ESMTPS id l4si10185878pdh.244.2014.11.21.11.44.43 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 21 Nov 2014 11:44:44 -0800 (PST) Received-SPF: pass (google.com: domain of john.stultz@linaro.org designates 209.85.220.46 as permitted sender) client-ip=209.85.220.46; Received: by mail-pa0-f46.google.com with SMTP id lj1so5482905pab.19 for ; Fri, 21 Nov 2014 11:44:43 -0800 (PST) X-Received: by 10.66.142.137 with SMTP id rw9mr10431612pab.124.1416599083758; Fri, 21 Nov 2014 11:44:43 -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.42 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 21 Nov 2014 11:44:43 -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 08/12] time: Expose get_monotonic_corase64() for in-kernel uses Date: Fri, 21 Nov 2014 11:44:14 -0800 Message-Id: <1416599058-13836-9-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.175 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 get_monotonic_coarse64() implementation that can be used as we convert internal users of get_monotonic_corase away from usingtimespecs. 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 | 11 ++++++++++- kernel/time/timekeeping.c | 4 ++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/include/linux/timekeeping.h b/include/linux/timekeeping.h index e40a8d6..8cab4b7 100644 --- a/include/linux/timekeeping.h +++ b/include/linux/timekeeping.h @@ -25,7 +25,7 @@ struct timespec __current_kernel_time(void); /* * timespec based interfaces */ -struct timespec get_monotonic_coarse(void); +struct timespec64 get_monotonic_coarse64(void); extern void getrawmonotonic64(struct timespec64 *ts); extern void ktime_get_ts64(struct timespec64 *ts); @@ -66,6 +66,10 @@ static inline void getrawmonotonic(struct timespec *ts) getrawmonotonic64(ts); } +static inline struct timespec get_monotonic_coarse(void) +{ + return get_monotonic_coarse64(); +} #else /** * Deprecated. Use do_settimeofday64(). @@ -118,6 +122,11 @@ static inline void getrawmonotonic(struct timespec *ts) getrawmonotonic64(&ts64); *ts = timespec64_to_timespec(ts64); } + +static inline struct timespec get_monotonic_coarse(void) +{ + return timespec64_to_timespec(get_monotonic_coarse64()); +} #endif extern void getboottime(struct timespec *ts); diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c index b329586..62440b1 100644 --- a/kernel/time/timekeeping.c +++ b/kernel/time/timekeeping.c @@ -1644,7 +1644,7 @@ struct timespec current_kernel_time(void) } EXPORT_SYMBOL(current_kernel_time); -struct timespec get_monotonic_coarse(void) +struct timespec64 get_monotonic_coarse64(void) { struct timekeeper *tk = &tk_core.timekeeper; struct timespec64 now, mono; @@ -1660,7 +1660,7 @@ struct timespec get_monotonic_coarse(void) set_normalized_timespec64(&now, now.tv_sec + mono.tv_sec, now.tv_nsec + mono.tv_nsec); - return timespec64_to_timespec(now); + return now; } /*