From patchwork Fri May 29 14:46:16 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xunlei Pang X-Patchwork-Id: 49222 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f69.google.com (mail-la0-f69.google.com [209.85.215.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 528A8218E7 for ; Fri, 29 May 2015 14:49:02 +0000 (UTC) Received: by lagv1 with SMTP id v1sf21314036lag.1 for ; Fri, 29 May 2015 07:49:01 -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=orftm+iePd7c+73/e9GuW7qZFRL57l1TaVm+fgSVgDY=; b=CR2AYenzWiD7ttmmDn6A049n8ovdUPRXpRjWyGDd2DdG9q7YKnoZ9vtk8J9dKs4Gls 12LOCCUstWWU493V13bsB3aKzxVZLXTRd+m2LcEdmR6x/xsISlYhrqMcYZ5TORrCu9IB /TEF+iRd0LhLREJpCXb8UVLn2bou3ReQOu8GPJrfo++7JoR14TEX/4JJ2Wq1ykXW/aZY rHTOEODB/pRpTC/1ZxFCwuh+u1WjkiujVEk4eXNMtuJE4qYvlslC6iQ/6ZBbM6xCnWQM EHf7QgT9/Vwxl3UCTfEN089YYSfkahc5ojXb7XYG2D8QM959EIZbnWagXRT7+fu+YNS5 wJPQ== X-Gm-Message-State: ALoCoQl7otuf61UMGu8rZm21x2l5qsYYku5KfGR+URLkfACmejSAekeAWStsAOKJ21KAObQ+PEJW X-Received: by 10.112.144.4 with SMTP id si4mr1079394lbb.17.1432910941101; Fri, 29 May 2015 07:49:01 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.120.105 with SMTP id lb9ls356812lab.10.gmail; Fri, 29 May 2015 07:49:00 -0700 (PDT) X-Received: by 10.152.36.227 with SMTP id t3mr8621357laj.12.1432910940923; Fri, 29 May 2015 07:49:00 -0700 (PDT) Received: from mail-la0-x22d.google.com (mail-la0-x22d.google.com. [2a00:1450:4010:c03::22d]) by mx.google.com with ESMTPS id ld3si4861521lac.92.2015.05.29.07.49.00 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 29 May 2015 07:49:00 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2a00:1450:4010:c03::22d as permitted sender) client-ip=2a00:1450:4010:c03::22d; Received: by labpy14 with SMTP id py14so45891088lab.0 for ; Fri, 29 May 2015 07:49:00 -0700 (PDT) X-Received: by 10.112.198.74 with SMTP id ja10mr8362884lbc.19.1432910940635; Fri, 29 May 2015 07:49:00 -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 hn6csp394111lbb; Fri, 29 May 2015 07:48:59 -0700 (PDT) X-Received: by 10.68.136.134 with SMTP id qa6mr15762364pbb.66.1432910938762; Fri, 29 May 2015 07:48:58 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id gf2si8728781pbd.94.2015.05.29.07.48.57; Fri, 29 May 2015 07:48:58 -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 S1756440AbbE2Osx (ORCPT + 28 others); Fri, 29 May 2015 10:48:53 -0400 Received: from m50-111.126.com ([123.125.50.111]:45774 "EHLO m50-111.126.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755020AbbE2Os0 (ORCPT ); Fri, 29 May 2015 10:48:26 -0400 Received: from localhost.localdomain (unknown [210.21.223.3]) by smtp5 (Coremail) with SMTP id jtKowAAHLTLCe2hVnOL+AA--.2718S3; Fri, 29 May 2015 22:46:51 +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, linux-cris-kernel@axis.com, Mikael Starvik , Jesper Nilsson , Xunlei Pang Subject: [PATCH v2 2/4] sparc: time: Replace update_persistent_clock() with CONFIG_RTC_SYSTOHC Date: Fri, 29 May 2015 22:46:16 +0800 Message-Id: <1432910778-314-2-git-send-email-xlpang@126.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1432910778-314-1-git-send-email-xlpang@126.com> References: <1432910778-314-1-git-send-email-xlpang@126.com> X-CM-TRANSID: jtKowAAHLTLCe2hVnOL+AA--.2718S3 X-Coremail-Antispam: 1Uf129KBjvJXoWxCw1xJr1UCry3XrW5Zr17GFg_yoW5tr4UpF ZakFn7Jr4DCayDuF17t34kuF17Xw47XrZrX34kKa409342vr1kXr4kur1vqryUtrWkZa1x WayrKFy3AayUW3DanT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x07jfwIDUUUUU= X-Originating-IP: [210.21.223.3] X-CM-SenderInfo: p0ost0bj6rjloofrz/1tbiXBwJv1R0WZTHuwAAsn 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::22d 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 On Sparc systems, update_persistent_clock() uses RTC drivers to do the job, it makes more sense to hand it over to CONFIG_RTC_SYSTOHC. In the long run, all the update_persistent_clock() should migrate to proper class RTC drivers if any and use CONFIG_RTC_SYSTOHC instead. Signed-off-by: Xunlei Pang --- arch/sparc/Kconfig | 2 +- arch/sparc/kernel/time_32.c | 21 --------------------- arch/sparc/kernel/time_64.c | 14 -------------- 3 files changed, 1 insertion(+), 36 deletions(-) diff --git a/arch/sparc/Kconfig b/arch/sparc/Kconfig index e49502a..56442d2 100644 --- a/arch/sparc/Kconfig +++ b/arch/sparc/Kconfig @@ -25,6 +25,7 @@ config SPARC select ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE select RTC_CLASS select RTC_DRV_M48T59 + select RTC_SYSTOHC select HAVE_DMA_ATTRS select HAVE_DMA_API_DEBUG select HAVE_ARCH_JUMP_LABEL if SPARC64 @@ -35,7 +36,6 @@ config SPARC select HAVE_BPF_JIT select HAVE_DEBUG_BUGVERBOSE select GENERIC_SMP_IDLE_THREAD - select GENERIC_CMOS_UPDATE select GENERIC_CLOCKEVENTS select GENERIC_STRNCPY_FROM_USER select GENERIC_STRNLEN_USER diff --git a/arch/sparc/kernel/time_32.c b/arch/sparc/kernel/time_32.c index 8caf45e..c9692f3 100644 --- a/arch/sparc/kernel/time_32.c +++ b/arch/sparc/kernel/time_32.c @@ -23,7 +23,6 @@ #include #include #include -#include #include #include #include @@ -65,8 +64,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,11 +84,6 @@ EXPORT_SYMBOL(profile_pc); volatile u32 __iomem *master_l10_counter; -int update_persistent_clock(struct timespec now) -{ - return set_rtc_mmss(now.tv_sec); -} - irqreturn_t notrace timer_interrupt(int dummy, void *dev_id) { if (timer_cs_enabled) { @@ -362,16 +354,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..2e6035c 100644 --- a/arch/sparc/kernel/time_64.c +++ b/arch/sparc/kernel/time_64.c @@ -28,7 +28,6 @@ #include #include #include -#include #include #include #include @@ -394,19 +393,6 @@ 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) -{ - 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; -} - unsigned long cmos_regs; EXPORT_SYMBOL(cmos_regs);