From patchwork Fri Jun 3 14:57:32 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marc Zyngier X-Patchwork-Id: 847372 Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p53F3Cl0023710 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Fri, 3 Jun 2011 15:03:33 GMT Received: from canuck.infradead.org ([2001:4978:20e::1]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1QSVsk-00010t-36; Fri, 03 Jun 2011 15:01:50 +0000 Received: from localhost ([127.0.0.1] helo=canuck.infradead.org) by canuck.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1QSVsh-0000gf-7n; Fri, 03 Jun 2011 15:01:47 +0000 Received: from service87.mimecast.com ([94.185.240.25]) by canuck.infradead.org with smtp (Exim 4.76 #1 (Red Hat Linux)) id 1QSVoW-0007kz-Dd for linux-arm-kernel@lists.infradead.org; Fri, 03 Jun 2011 14:57:32 +0000 Received: from cam-owa2.Emea.Arm.com (fw-tnat.cambridge.arm.com [217.140.96.21]) by service87.mimecast.com; Fri, 03 Jun 2011 15:57:26 +0100 Received: from localhost.localdomain ([10.1.255.212]) by cam-owa2.Emea.Arm.com with Microsoft SMTPSVC(6.0.3790.3959); Fri, 3 Jun 2011 15:57:24 +0100 From: Marc Zyngier To: linux-arm-kernel@lists.infradead.org Subject: [PATCH v1 17/18] ARM: simplify percpu_timer_setup Date: Fri, 3 Jun 2011 15:57:32 +0100 Message-Id: <1307113053-30209-18-git-send-email-marc.zyngier@arm.com> X-Mailer: git-send-email 1.7.0.4 In-Reply-To: <1307113053-30209-1-git-send-email-marc.zyngier@arm.com> References: <1307113053-30209-1-git-send-email-marc.zyngier@arm.com> X-OriginalArrivalTime: 03 Jun 2011 14:57:24.0288 (UTC) FILETIME=[8C1AD400:01CC21FE] X-MC-Unique: 111060315572606801 X-CRM114-Version: 20090807-BlameThorstenAndJenny ( TRE 0.7.6 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20110603_105729_002900_D1B1FF33 X-CRM114-Status: GOOD ( 13.13 ) X-Spam-Score: -0.7 (/) X-Spam-Report: SpamAssassin version 3.3.1 on canuck.infradead.org summary: Content analysis details: (-0.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [94.185.240.25 listed in list.dnswl.org] X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Fri, 03 Jun 2011 15:03:33 +0000 (UTC) Now that all in-tree providers of local_timer_setup() are dynamically registering their timers with the per cpu timer code, remove the legacy timer selection code. If no local timer is provided, a broadcast timer will be used as a fallback. Acked-by: Catalin Marinas Signed-off-by: Marc Zyngier --- arch/arm/include/asm/localtimer.h | 5 ----- arch/arm/include/asm/smp_twd.h | 8 +------- arch/arm/kernel/percpu_timer.c | 20 +------------------- arch/arm/kernel/smp_twd.c | 12 ++---------- 4 files changed, 4 insertions(+), 41 deletions(-) diff --git a/arch/arm/include/asm/localtimer.h b/arch/arm/include/asm/localtimer.h index f95e527..263c1cf 100644 --- a/arch/arm/include/asm/localtimer.h +++ b/arch/arm/include/asm/localtimer.h @@ -44,11 +44,6 @@ struct local_timer_ops { #ifdef CONFIG_LOCAL_TIMERS /* - * Setup a local timer interrupt for a CPU. - */ -int local_timer_setup(struct clock_event_device *); - -/* * Register a local timer. */ void percpu_timer_register(struct local_timer_ops *); diff --git a/arch/arm/include/asm/smp_twd.h b/arch/arm/include/asm/smp_twd.h index d2abe52..2c01220 100644 --- a/arch/arm/include/asm/smp_twd.h +++ b/arch/arm/include/asm/smp_twd.h @@ -23,15 +23,9 @@ extern void __iomem *twd_base; #ifdef CONFIG_HAVE_ARM_TWD -struct local_timer_ops *local_timer_get_twd_ops(void); int twd_timer_register_setup(int (*setup)(struct clock_event_device *)); #else -static inline struct local_timer_ops *local_timer_get_twd_ops(void) -{ - return NULL; -} - -static inline int twd_timer_register_setup(int (*setup)(struct clock_event_device *)) +static inline int twd_timer_register_setup(void (*setup)(struct clock_event_device *)) { return -ENODEV; } diff --git a/arch/arm/kernel/percpu_timer.c b/arch/arm/kernel/percpu_timer.c index 94315f5..f442d3f 100644 --- a/arch/arm/kernel/percpu_timer.c +++ b/arch/arm/kernel/percpu_timer.c @@ -15,7 +15,6 @@ #include #include -#include #ifdef CONFIG_GENERIC_CLOCKEVENTS_BROADCAST static void broadcast_timer_set_mode(enum clock_event_mode mode, @@ -45,12 +44,7 @@ static struct local_timer_ops broadcast_timer_ops = { .setup = broadcast_timer_setup, }; -static struct local_timer_ops *timer_ops; - -int __attribute__ ((weak)) local_timer_setup(struct clock_event_device *evt) -{ - return -ENXIO; -} +static struct local_timer_ops *timer_ops = &broadcast_timer_ops; void percpu_timer_register(struct local_timer_ops *ops) { @@ -108,18 +102,6 @@ void __cpuinit percpu_timer_setup(void) unsigned int cpu = smp_processor_id(); struct clock_event_device *evt = &per_cpu(percpu_clockevent, cpu); - /* - * All this can go away once we've migrated all users to - * properly register the timer they use, and broadcast can - * become the fallback. - */ - if (!timer_ops) - timer_ops = local_timer_get_twd_ops(); - if (!timer_ops) - timer_ops = &broadcast_timer_ops; - if (!timer_ops->plat_setup) - timer_ops->plat_setup = local_timer_setup; - evt->cpumask = cpumask_of(cpu); if (timer_ops->pre_setup) diff --git a/arch/arm/kernel/smp_twd.c b/arch/arm/kernel/smp_twd.c index 91296df..5773955 100644 --- a/arch/arm/kernel/smp_twd.c +++ b/arch/arm/kernel/smp_twd.c @@ -168,20 +168,12 @@ static struct local_timer_ops twd_timer_ops = { .ack = twd_timer_ack, }; -struct local_timer_ops *local_timer_get_twd_ops(void) +int __init twd_timer_register_setup(int (*setup)(struct clock_event_device *)) { if (!twd_base) { pr_warn("TWD base address not set\n"); - return NULL; - } - - return &twd_timer_ops; -} - -int __init twd_timer_register_setup(int (*setup)(struct clock_event_device *)) -{ - if (!twd_base) return -ENODEV; + } percpu_timer_register_setup(&twd_timer_ops, setup, NULL); return 0;