From patchwork Fri May 15 09:31:32 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xunlei Pang X-Patchwork-Id: 48557 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 3B2AF21411 for ; Fri, 15 May 2015 10:06:08 +0000 (UTC) Received: by wivs14 with SMTP id s14sf32727997wiv.1 for ; Fri, 15 May 2015 03:06:07 -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:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=YHiPBJTHn/iGca5sKn+CnqSrE0Ug/Ryyma2i4UFV3F0=; b=Gbj8OhnFJzx9RFAswua6lV0g45iFcFKEpLibGd1bb9r2JAgeEaXXLvLvu2ZdH+uUC8 QVUP9PWph8LzSxQYq02JJyUlJ5NeDrEDRrHJlYjKghD3urXeFqBQyeGpPyHL8uUr8pwO q/mEjXU6fv2bmGo5JadrrcGlwXf8y4zY0h76F9KLgvyGzN1obyBQCodaUFpLjQW04Ccq j3Qx5NpXRSf2cKlx52aJvUi+y/6uVz6GNR2DQQwG2hTT0SwF38ilgxwLQkANCeKqPl2K GzB3x4LGxoHmxTxuiQePVJ18RTVawl5nEJ3B9PT8DOGjL6/Wd8hvT+1EJv7q+au4qx6i aRAA== X-Gm-Message-State: ALoCoQnZkD8ElBnfbYW6V73/CfYJ5pPYQJayY9aom3RJUTmkE1rQZssmEHH3+OY3uGq6aD7sEc4v X-Received: by 10.112.151.146 with SMTP id uq18mr6509268lbb.20.1431684367206; Fri, 15 May 2015 03:06:07 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.153.7.67 with SMTP id da3ls585975lad.49.gmail; Fri, 15 May 2015 03:06:07 -0700 (PDT) X-Received: by 10.152.27.194 with SMTP id v2mr6421802lag.75.1431684367031; Fri, 15 May 2015 03:06:07 -0700 (PDT) Received: from mail-la0-x22e.google.com (mail-la0-x22e.google.com. [2a00:1450:4010:c03::22e]) by mx.google.com with ESMTPS id uh8si740421lac.136.2015.05.15.03.06.06 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 15 May 2015 03:06:06 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2a00:1450:4010:c03::22e as permitted sender) client-ip=2a00:1450:4010:c03::22e; Received: by laat2 with SMTP id t2so111586912laa.1 for ; Fri, 15 May 2015 03:06:06 -0700 (PDT) X-Received: by 10.152.4.137 with SMTP id k9mr6472988lak.29.1431684366597; Fri, 15 May 2015 03:06:06 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.108.230 with SMTP id hn6csp1900581lbb; Fri, 15 May 2015 03:06:05 -0700 (PDT) X-Received: by 10.68.211.197 with SMTP id ne5mr1358783pbc.156.1431684364774; Fri, 15 May 2015 03:06:04 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ca5si1854265pac.147.2015.05.15.03.05.34; Fri, 15 May 2015 03:06:04 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934045AbbEOKFH (ORCPT + 28 others); Fri, 15 May 2015 06:05:07 -0400 Received: from m50-111.126.com ([123.125.50.111]:49469 "EHLO m50-111.126.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754127AbbEOKFB (ORCPT ); Fri, 15 May 2015 06:05:01 -0400 Received: from localhost.localdomain (unknown [210.21.223.3]) by smtp5 (Coremail) with SMTP id jtKowAAXZ1_7vFVVPiEDAA--.523S3; Fri, 15 May 2015 17:31:47 +0800 (CST) From: Xunlei Pang To: linux-kernel@vger.kernel.org Cc: rtc-linux@googlegroups.com, Alessandro Zummo , John Stultz , Arnd Bergmann , "David S. Miller" , sparclinux@vger.kernel.org, Xunlei Pang Subject: [PATCH 2/2] sparc: time: Provide update_persistent_clock64() Date: Fri, 15 May 2015 17:31:32 +0800 Message-Id: <1431682292-29732-2-git-send-email-xlpang@126.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1431682292-29732-1-git-send-email-xlpang@126.com> References: <1431682292-29732-1-git-send-email-xlpang@126.com> X-CM-TRANSID: jtKowAAXZ1_7vFVVPiEDAA--.523S3 X-Coremail-Antispam: 1Uf129KBjvJXoW7trWxWrWUZw45JFyDJw4DCFg_yoW8KF1fpF WxAFnxGr4UKayq9FnrtwnrZF1jgw1jqasFga4vg34F9r10qr18GF1xC3yvvryjqFZ5Ja1U CayUtFW3Zw1Uuw7anT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x07jh-B_UUUUU= X-Originating-IP: [210.21.223.3] X-CM-SenderInfo: p0ost0bj6rjloofrz/1tbiXAP6v1R0WLizTwAAsm Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Original-Sender: xlpang@126.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2a00:1450:4010:c03::22e as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org; dkim=neutral (body hash did not verify) header.i=@; dmarc=fail (p=NONE dis=NONE) header.from=126.com Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org 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 update_persistent_clock() to update_persistent_clock64() using timespec64 for both 32-bit and 64-bit sparc, since timekeeping had already supported update_persistent_clock64(). Signed-off-by: Xunlei Pang --- arch/sparc/kernel/time_32.c | 27 ++++++++++----------------- arch/sparc/kernel/time_64.c | 2 +- 2 files changed, 11 insertions(+), 18 deletions(-) diff --git a/arch/sparc/kernel/time_32.c b/arch/sparc/kernel/time_32.c index 18147a5..47b295f 100644 --- a/arch/sparc/kernel/time_32.c +++ b/arch/sparc/kernel/time_32.c @@ -65,8 +65,6 @@ DEFINE_PER_CPU(struct clock_event_device, sparc32_clockevent); DEFINE_SPINLOCK(rtc_lock); EXPORT_SYMBOL(rtc_lock); -static int set_rtc_mmss(unsigned long); - unsigned long profile_pc(struct pt_regs *regs) { extern char __copy_user_begin[], __copy_user_end[]; @@ -87,9 +85,17 @@ EXPORT_SYMBOL(profile_pc); volatile u32 __iomem *master_l10_counter; -int update_persistent_clock(struct timespec now) +int update_persistent_clock64(struct timespec64 now) { - return set_rtc_mmss(now.tv_sec); + struct rtc_device *rtc = rtc_class_open("rtc0"); + int err = -1; + + if (rtc) { + err = rtc_set_mmss(rtc, now.tv_sec); + rtc_class_close(rtc); + } + + return err; } irqreturn_t notrace timer_interrupt(int dummy, void *dev_id) @@ -362,16 +368,3 @@ void __init time_init(void) sbus_time_init(); } - -static int set_rtc_mmss(unsigned long secs) -{ - struct rtc_device *rtc = rtc_class_open("rtc0"); - int err = -1; - - if (rtc) { - err = rtc_set_mmss(rtc, secs); - rtc_class_close(rtc); - } - - return err; -} diff --git a/arch/sparc/kernel/time_64.c b/arch/sparc/kernel/time_64.c index edbbeb1..7c8f819 100644 --- a/arch/sparc/kernel/time_64.c +++ b/arch/sparc/kernel/time_64.c @@ -394,7 +394,7 @@ static struct sparc64_tick_ops hbtick_operations __read_mostly = { static unsigned long timer_ticks_per_nsec_quotient __read_mostly; -int update_persistent_clock(struct timespec now) +int update_persistent_clock64(struct timespec64 now) { struct rtc_device *rtc = rtc_class_open("rtc0"); int err = -1;