From patchwork Sat Nov 8 04:26: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: 40458 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 20EA920D85 for ; Sat, 8 Nov 2014 04:26:29 +0000 (UTC) Received: by mail-la0-f71.google.com with SMTP id gq15sf3647578lab.6 for ; Fri, 07 Nov 2014 20:26:28 -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=iTF87ZdZ+lPi8cDGV6CxyMhsVVFPoUubIon4hGp8BBY=; b=hyvFKeqs0MX47g5XzESe/udpsm3NQvizcE1++UkNe8pyagYMKCjlmkIetk1I4XyPQS vp5d3xHvnOEUtxzB6qRvPiEvV/eU5jGElR7zvyBQUkHhWkGPKYUvfFYyMf7ypNLMbch+ iVqzyOKr16ctOVAtszvAU4Y+N3g1cSqxJb2eTRIMID8mY1ObYfVI6wHRXraTtJDmORct gM7pgnUzdhlcPOombAmO1I9L72CqMI/ui5gPVXviGciL6JRToF7X0JSvsMEgRok6eyut MheCswCIoEiMAhFytOfWBaEgmi5LbIaC8RS8Ie6o8tcoZiSOrhRq0EYTJ8/siCIXuCf7 fAnA== X-Gm-Message-State: ALoCoQlV51Q1kGCn/crp8o2vpEHD8KsX1QClkZZEA4Lz+0PVyW72QGOQ7mjHjwKUoAzxP/w0oQTG X-Received: by 10.181.11.193 with SMTP id ek1mr1546142wid.0.1415420788066; Fri, 07 Nov 2014 20:26:28 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.153.4.33 with SMTP id cb1ls304357lad.89.gmail; Fri, 07 Nov 2014 20:26:27 -0800 (PST) X-Received: by 10.153.6.9 with SMTP id cq9mr6683874lad.79.1415420787417; Fri, 07 Nov 2014 20:26:27 -0800 (PST) Received: from mail-la0-f53.google.com (mail-la0-f53.google.com. [209.85.215.53]) by mx.google.com with ESMTPS id f4si17260985laf.102.2014.11.07.20.26.27 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 07 Nov 2014 20:26:27 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.53 as permitted sender) client-ip=209.85.215.53; Received: by mail-la0-f53.google.com with SMTP id mc6so5359004lab.26 for ; Fri, 07 Nov 2014 20:26:27 -0800 (PST) X-Received: by 10.152.116.102 with SMTP id jv6mr9368795lab.40.1415420787002; Fri, 07 Nov 2014 20:26:27 -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 ew9csp306424lbc; Fri, 7 Nov 2014 20:26:26 -0800 (PST) X-Received: by 10.66.191.8 with SMTP id gu8mr16913801pac.126.1415420785393; Fri, 07 Nov 2014 20:26:25 -0800 (PST) Received: from mail-pa0-f53.google.com (mail-pa0-f53.google.com. [209.85.220.53]) by mx.google.com with ESMTPS id ry7si878306pab.104.2014.11.07.20.26.24 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 07 Nov 2014 20:26:25 -0800 (PST) Received-SPF: pass (google.com: domain of john.stultz@linaro.org designates 209.85.220.53 as permitted sender) client-ip=209.85.220.53; Received: by mail-pa0-f53.google.com with SMTP id kx10so4760195pab.40 for ; Fri, 07 Nov 2014 20:26:24 -0800 (PST) X-Received: by 10.70.5.130 with SMTP id s2mr16977062pds.17.1415420784708; Fri, 07 Nov 2014 20:26:24 -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 n3sm10235061pda.7.2014.11.07.20.26.23 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 07 Nov 2014 20:26:24 -0800 (PST) From: John Stultz To: "pang.xunlei" Cc: John Stultz , Arnd Bergmann Subject: [PATCH 3/4] time: Expose timekeeping_inject_sleeptime64() to in-kernel users Date: Fri, 7 Nov 2014 20:26:14 -0800 Message-Id: <1415420775-4987-3-git-send-email-john.stultz@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1415420775-4987-1-git-send-email-john.stultz@linaro.org> References: <1415420775-4987-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.53 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 timekeeping_inject_sleeptime64() interface to allow us to replace existing timekeeping_inject_sleeptime() users as we cleanup timespec usage in the kernel. Cc: Arnd Bergmann Signed-off-by: John Stultz --- include/linux/timekeeping.h | 18 +++++++++++++++++- kernel/time/timekeeping.c | 10 ++++------ 2 files changed, 21 insertions(+), 7 deletions(-) diff --git a/include/linux/timekeeping.h b/include/linux/timekeeping.h index b94db3c..96e11e2 100644 --- a/include/linux/timekeeping.h +++ b/include/linux/timekeeping.h @@ -204,7 +204,23 @@ static inline void timekeeping_clocktai(struct timespec *ts) /* * RTC specific */ -extern void timekeeping_inject_sleeptime(struct timespec *delta); +extern void timekeeping_inject_sleeptime64(struct timespec64 *delta); + +#if BITS_PER_LONG == 64 +static inline void timekeeping_inject_sleeptime(struct timespec *delta) +{ + timekeeping_inject_sleeptime64(delta); +} +#else +static inline void timekeeping_inject_sleeptime(struct timespec *delta) +{ + struct timespec64 ts; + + ts = timespec_to_timespec64(*delta); + timekeeping_inject_sleeptime64(&ts); +} +#endif + /* * PPS accessor diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c index 653d251..9491a58 100644 --- a/kernel/time/timekeeping.c +++ b/kernel/time/timekeeping.c @@ -1069,8 +1069,8 @@ static void __timekeeping_inject_sleeptime(struct timekeeper *tk, } /** - * timekeeping_inject_sleeptime - Adds suspend interval to timeekeeping values - * @delta: pointer to a timespec delta value + * timekeeping_inject_sleeptime64 - Adds suspend interval to timeekeeping values + * @delta: pointer to a timespec64 delta value * * This hook is for architectures that cannot support read_persistent_clock * because their RTC/persistent clock is only accessible when irqs are enabled. @@ -1078,10 +1078,9 @@ static void __timekeeping_inject_sleeptime(struct timekeeper *tk, * This function should only be called by rtc_resume(), and allows * a suspend offset to be injected into the timekeeping values. */ -void timekeeping_inject_sleeptime(struct timespec *delta) +void timekeeping_inject_sleeptime64(struct timespec64 *delta) { struct timekeeper *tk = &tk_core.timekeeper; - struct timespec64 tmp; unsigned long flags; /* @@ -1096,8 +1095,7 @@ void timekeeping_inject_sleeptime(struct timespec *delta) timekeeping_forward_now(tk); - tmp = timespec_to_timespec64(*delta); - __timekeeping_inject_sleeptime(tk, &tmp); + __timekeeping_inject_sleeptime(tk, delta); timekeeping_update(tk, TK_CLEAR_NTP | TK_MIRROR | TK_CLOCK_WAS_SET);