From patchwork Thu Apr 2 03:34:26 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Stultz X-Patchwork-Id: 46682 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f198.google.com (mail-wi0-f198.google.com [209.85.212.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 8F613216D1 for ; Thu, 2 Apr 2015 03:35:11 +0000 (UTC) Received: by wiaa2 with SMTP id a2sf15689701wia.1 for ; Wed, 01 Apr 2015 20:35:10 -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=EjG1RuD13DQ91gmrca6IjzZap8Tiqve1h6TKa2Iq7LI=; b=DVQEzswLevYK9yqnwM97nwNZ7UA+lT0W6sXcVtl6rwOcEl+B+1BrmO1+VABHxO+Zn2 xAQ2E1SvDeZZMMeL/966dbHdJGe5Yoyb4/VYRthcay8cUHBPnZ+Jx5HgPR5qc7jxcFoB aPuABf4vcUeqS8tJoHTaRn1wvwhqSaPOS/u3vR/30iJsVuZROVF1b4ihsOH3D7qA4RWf BhrYFIazctgcxBFWHXkUtBmn8T6OGRNTBzwulMDkRxZvMuzb+J3/JvyqVPjXLytqmdgd tkpyxEWSG2GwpIY27GrjGwPJlXmoBhqganNsjwCuezO2933AdJgl9KkTL7dpEuCuAX9/ OR4Q== X-Gm-Message-State: ALoCoQkB9B2aH4UPDINRjchDOpftnzPt2Mob6FnZOA4mVVDxPQVvAlbrxG6/5T9Q1F/lJ0Eo1xVb X-Received: by 10.112.142.1 with SMTP id rs1mr10182158lbb.19.1427945710823; Wed, 01 Apr 2015 20:35:10 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.87.42 with SMTP id u10ls5668laz.64.gmail; Wed, 01 Apr 2015 20:35:10 -0700 (PDT) X-Received: by 10.112.160.227 with SMTP id xn3mr24463067lbb.112.1427945710687; Wed, 01 Apr 2015 20:35:10 -0700 (PDT) Received: from mail-la0-f47.google.com (mail-la0-f47.google.com. [209.85.215.47]) by mx.google.com with ESMTPS id b5si3140652laf.46.2015.04.01.20.35.10 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 01 Apr 2015 20:35:10 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.47 as permitted sender) client-ip=209.85.215.47; Received: by lajy8 with SMTP id y8so50904404laj.0 for ; Wed, 01 Apr 2015 20:35:10 -0700 (PDT) X-Received: by 10.112.162.167 with SMTP id yb7mr37755356lbb.76.1427945710596; Wed, 01 Apr 2015 20:35:10 -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.57.201 with SMTP id k9csp1063206lbq; Wed, 1 Apr 2015 20:35:09 -0700 (PDT) X-Received: by 10.70.45.227 with SMTP id q3mr26099179pdm.22.1427945694789; Wed, 01 Apr 2015 20:34:54 -0700 (PDT) Received: from mail-pd0-f179.google.com (mail-pd0-f179.google.com. [209.85.192.179]) by mx.google.com with ESMTPS id ey5si5530936pab.172.2015.04.01.20.34.53 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 01 Apr 2015 20:34:54 -0700 (PDT) Received-SPF: pass (google.com: domain of john.stultz@linaro.org designates 209.85.192.179 as permitted sender) client-ip=209.85.192.179; Received: by pdea3 with SMTP id a3so24272975pde.3 for ; Wed, 01 Apr 2015 20:34:53 -0700 (PDT) X-Received: by 10.68.226.35 with SMTP id rp3mr84350219pbc.54.1427945693885; Wed, 01 Apr 2015 20:34:53 -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 da10sm3572603pac.42.2015.04.01.20.34.52 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 01 Apr 2015 20:34:53 -0700 (PDT) From: John Stultz To: lkml Cc: Xunlei Pang , Peter Zijlstra , Thomas Gleixner , Ingo Molnar , John Stultz Subject: [PATCH 06/21] ARM: time: Provide read_boot_clock64() and read_persistent_clock64() Date: Wed, 1 Apr 2015 20:34:26 -0700 Message-Id: <1427945681-29972-7-git-send-email-john.stultz@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1427945681-29972-1-git-send-email-john.stultz@linaro.org> References: <1427945681-29972-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.47 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 by converting clock_access_fn to use timespec64. Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: Ingo Molnar Acked-by: Thierry Reding (for tegra part) Signed-off-by: Xunlei Pang Signed-off-by: John Stultz --- arch/arm/include/asm/mach/time.h | 3 +-- arch/arm/kernel/time.c | 6 +++--- arch/arm/plat-omap/counter_32k.c | 10 +--------- drivers/clocksource/tegra20_timer.c | 10 +--------- 4 files changed, 6 insertions(+), 23 deletions(-) diff --git a/arch/arm/include/asm/mach/time.h b/arch/arm/include/asm/mach/time.h index 90c12e1..0f79e4d 100644 --- a/arch/arm/include/asm/mach/time.h +++ b/arch/arm/include/asm/mach/time.h @@ -12,8 +12,7 @@ extern void timer_tick(void); -struct timespec; -typedef void (*clock_access_fn)(struct timespec *); +typedef void (*clock_access_fn)(struct timespec64 *); extern int register_persistent_clock(clock_access_fn read_boot, clock_access_fn read_persistent); diff --git a/arch/arm/kernel/time.c b/arch/arm/kernel/time.c index 0cc7e58..a66e37e 100644 --- a/arch/arm/kernel/time.c +++ b/arch/arm/kernel/time.c @@ -76,7 +76,7 @@ void timer_tick(void) } #endif -static void dummy_clock_access(struct timespec *ts) +static void dummy_clock_access(struct timespec64 *ts) { ts->tv_sec = 0; ts->tv_nsec = 0; @@ -85,12 +85,12 @@ static void dummy_clock_access(struct timespec *ts) static clock_access_fn __read_persistent_clock = dummy_clock_access; static clock_access_fn __read_boot_clock = dummy_clock_access;; -void read_persistent_clock(struct timespec *ts) +void read_persistent_clock64(struct timespec64 *ts) { __read_persistent_clock(ts); } -void read_boot_clock(struct timespec *ts) +void read_boot_clock64(struct timespec64 *ts) { __read_boot_clock(ts); } diff --git a/arch/arm/plat-omap/counter_32k.c b/arch/arm/plat-omap/counter_32k.c index b7b7b07..2438b96 100644 --- a/arch/arm/plat-omap/counter_32k.c +++ b/arch/arm/plat-omap/counter_32k.c @@ -70,14 +70,6 @@ static void omap_read_persistent_clock64(struct timespec64 *ts) *ts = persistent_ts; } -static void omap_read_persistent_clock(struct timespec *ts) -{ - struct timespec64 ts64; - - omap_read_persistent_clock64(&ts64); - *ts = timespec64_to_timespec(ts64); -} - /** * omap_init_clocksource_32k - setup and register counter 32k as a * kernel clocksource @@ -118,7 +110,7 @@ int __init omap_init_clocksource_32k(void __iomem *vbase) } sched_clock_register(omap_32k_read_sched_clock, 32, 32768); - register_persistent_clock(NULL, omap_read_persistent_clock); + register_persistent_clock(NULL, omap_read_persistent_clock64); pr_info("OMAP clocksource: 32k_counter at 32768 Hz\n"); return 0; diff --git a/drivers/clocksource/tegra20_timer.c b/drivers/clocksource/tegra20_timer.c index 4a0a603..5a112d7 100644 --- a/drivers/clocksource/tegra20_timer.c +++ b/drivers/clocksource/tegra20_timer.c @@ -141,14 +141,6 @@ static void tegra_read_persistent_clock64(struct timespec64 *ts) *ts = persistent_ts; } -static void tegra_read_persistent_clock(struct timespec *ts) -{ - struct timespec ts64; - - tegra_read_persistent_clock64(&ts64); - *ts = timespec64_to_timespec(ts64); -} - static unsigned long tegra_delay_timer_read_counter_long(void) { return readl(timer_reg_base + TIMERUS_CNTR_1US); @@ -259,7 +251,7 @@ static void __init tegra20_init_rtc(struct device_node *np) else clk_prepare_enable(clk); - register_persistent_clock(NULL, tegra_read_persistent_clock); + register_persistent_clock(NULL, tegra_read_persistent_clock64); } CLOCKSOURCE_OF_DECLARE(tegra20_rtc, "nvidia,tegra20-rtc", tegra20_init_rtc);