From patchwork Fri Jun 12 03:10:17 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xunlei Pang X-Patchwork-Id: 49783 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f70.google.com (mail-la0-f70.google.com [209.85.215.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id DFCC220C81 for ; Fri, 12 Jun 2015 03:13:30 +0000 (UTC) Received: by labsp1 with SMTP id sp1sf7071964lab.3 for ; Thu, 11 Jun 2015 20:13:29 -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=nJ/A57kJ102rfdZZ1ONfN7ZZdGiDqrvjQn/GawAOzLZgNet5gyaPvdKsRvWKt+dswz 8dowwlfzfx5C97EZSh38Qv9d9czGzwOFpt/5DBg4ZPhAblPZsm0moIqnnEvvIgQYLJ8F CfdFXsRBhMxq08XIDJMeiW5snK3JzIt4vd2XDpsTGQAIfBfeZqZ8YbUsw8kAbmOcgdc+ 7eMmcEWSXZtuUWpSZPEe28bmN1JRyKrK6VSssVlJhvF+FUshjGGQvu1XV1wskHFnfJu3 R9YWbs/LwmiMO7jpt9A2PXo266A36sH2uY+Q5xL3PAIv75Yy3jazQ+jFmCCw3hb85nzg ZWPw== X-Gm-Message-State: ALoCoQmGV5tPYAirLS6pSgfsvsm4uzw2sSrnn+y8pSnNDbocw0/D9KO90ofDU+EwUgGNG6d4njTn X-Received: by 10.180.89.231 with SMTP id br7mr1727118wib.0.1434078809838; Thu, 11 Jun 2015 20:13:29 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.36.101 with SMTP id p5ls569190laj.53.gmail; Thu, 11 Jun 2015 20:13:29 -0700 (PDT) X-Received: by 10.152.36.65 with SMTP id o1mr13257507laj.55.1434078809429; Thu, 11 Jun 2015 20:13:29 -0700 (PDT) Received: from mail-lb0-x22b.google.com (mail-lb0-x22b.google.com. [2a00:1450:4010:c04::22b]) by mx.google.com with ESMTPS id ro2si2233641lbb.135.2015.06.11.20.13.29 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 11 Jun 2015 20:13:29 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2a00:1450:4010:c04::22b as permitted sender) client-ip=2a00:1450:4010:c04::22b; Received: by lbbqq2 with SMTP id qq2so12515009lbb.3 for ; Thu, 11 Jun 2015 20:13:29 -0700 (PDT) X-Received: by 10.112.41.196 with SMTP id h4mr13016977lbl.36.1434078809260; Thu, 11 Jun 2015 20:13:29 -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 hn6csp242753lbb; Thu, 11 Jun 2015 20:13:28 -0700 (PDT) X-Received: by 10.66.100.138 with SMTP id ey10mr19383290pab.110.1434078806862; Thu, 11 Jun 2015 20:13:26 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r8si3387590pds.154.2015.06.11.20.13.26; Thu, 11 Jun 2015 20:13:26 -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 S1752811AbbFLDNU (ORCPT + 29 others); Thu, 11 Jun 2015 23:13:20 -0400 Received: from m50-111.126.com ([123.125.50.111]:54285 "EHLO m50-111.126.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752608AbbFLDNP (ORCPT ); Thu, 11 Jun 2015 23:13:15 -0400 Received: from localhost.localdomain (unknown [210.21.223.3]) by smtp5 (Coremail) with SMTP id jtKowAAnbaa5TXpVUaYwAQ--.1090S3; Fri, 12 Jun 2015 11:11:09 +0800 (CST) From: Xunlei Pang To: linux-kernel@vger.kernel.org Cc: rtc-linux@googlegroups.com, Alessandro Zummo , Alexandre Belloni , John Stultz , Arnd Bergmann , "David S. Miller" , sparclinux@vger.kernel.org, Xunlei Pang Subject: [PATCH v3 2/3] sparc: time: Replace update_persistent_clock() with CONFIG_RTC_SYSTOHC Date: Fri, 12 Jun 2015 11:10:17 +0800 Message-Id: <1434078618-16373-2-git-send-email-xlpang@126.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1434078618-16373-1-git-send-email-xlpang@126.com> References: <1434078618-16373-1-git-send-email-xlpang@126.com> X-CM-TRANSID: jtKowAAnbaa5TXpVUaYwAQ--.1090S3 X-Coremail-Antispam: 1Uf129KBjvJXoWxCw1xJr1UCry3XrW5Zr17GFg_yoW5tr4UpF ZakFn7Jr4DCayDuF17t34kuF17Xw47XrZrX34kKa409342vr1kXr4kur1vqryUtrWkZa1x WayrKFy3AayUW3DanT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x07jh-B_UUUUU= X-Originating-IP: [210.21.223.3] X-CM-SenderInfo: p0ost0bj6rjloofrz/1tbi7w0Xv1UwyGFRrAAAs7 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:c04::22b as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org; dkim=neutral (body hash did not verify) header.i=@126.com; 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);