From patchwork Tue Aug 9 09:56:41 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marc Zyngier X-Patchwork-Id: 1048772 Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by demeter2.kernel.org (8.14.4/8.14.4) with ESMTP id p799wgbt018576 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Tue, 9 Aug 2011 09:59:03 GMT Received: from canuck.infradead.org ([2001:4978:20e::1]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1Qqj4j-0005zx-J9; Tue, 09 Aug 2011 09:58:18 +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 1Qqj4Y-0002vK-S3; Tue, 09 Aug 2011 09:58:06 +0000 Received: from service87.mimecast.com ([94.185.240.25]) by canuck.infradead.org with smtp (Exim 4.76 #1 (Red Hat Linux)) id 1Qqj3R-0002gj-W6 for linux-arm-kernel@lists.infradead.org; Tue, 09 Aug 2011 09:57:01 +0000 Received: from cam-owa2.Emea.Arm.com (fw-tnat.cambridge.arm.com [217.140.96.21]) by service87.mimecast.com; Tue, 09 Aug 2011 10:56:52 +0100 Received: from localhost.localdomain ([10.1.255.212]) by cam-owa2.Emea.Arm.com with Microsoft SMTPSVC(6.0.3790.3959); Tue, 9 Aug 2011 10:56:39 +0100 From: Marc Zyngier To: linux-arm-kernel@lists.infradead.org Subject: [PATCH v11 3/4] ARM: local timers: drop local_timer_ack() Date: Tue, 9 Aug 2011 10:56:41 +0100 Message-Id: <1312883802-15022-4-git-send-email-marc.zyngier@arm.com> X-Mailer: git-send-email 1.7.0.4 In-Reply-To: <1312883802-15022-1-git-send-email-marc.zyngier@arm.com> References: <1312883802-15022-1-git-send-email-marc.zyngier@arm.com> X-OriginalArrivalTime: 09 Aug 2011 09:56:39.0219 (UTC) FILETIME=[A2151030:01CC567A] X-MC-Unique: 111080910565204201 X-CRM114-Version: 20090807-BlameThorstenAndJenny ( TRE 0.7.6 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20110809_055658_430510_2B853ED4 X-CRM114-Status: GOOD ( 14.95 ) 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] Cc: David Brown , Kukjin Kim 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 (demeter2.kernel.org [140.211.167.43]); Tue, 09 Aug 2011 09:59:03 +0000 (UTC) Only TWD uses local_timer_ack() to perform something useful. Make it the real (private) interrupt handler, remove the common interrupt handler as well as the useless stubs from MCT and MSM. Cc: Kukjin Kim Cc: David Brown Signed-off-by: Marc Zyngier --- arch/arm/include/asm/localtimer.h | 12 ------------ arch/arm/include/asm/smp_twd.h | 1 - arch/arm/kernel/smp.c | 14 -------------- arch/arm/kernel/smp_twd.c | 17 +++++++---------- arch/arm/mach-exynos4/mct.c | 6 ------ arch/arm/mach-msm/timer.c | 6 ------ 6 files changed, 7 insertions(+), 49 deletions(-) diff --git a/arch/arm/include/asm/localtimer.h b/arch/arm/include/asm/localtimer.h index 136a31b..f5e1cec 100644 --- a/arch/arm/include/asm/localtimer.h +++ b/arch/arm/include/asm/localtimer.h @@ -19,29 +19,17 @@ struct clock_event_device; */ void percpu_timer_setup(void); -/* - * Per-cpu timer IRQ handler - */ -irqreturn_t percpu_timer_handler(int irq, void *dev_id); - #ifdef CONFIG_LOCAL_TIMERS #ifdef CONFIG_HAVE_ARM_TWD #include "smp_twd.h" -#define local_timer_ack() twd_timer_ack() #define local_timer_stop(c) twd_timer_stop((c)) #else /* - * Platform provides this to acknowledge a local timer IRQ. - * Returns true if the local timer IRQ is to be processed. - */ -int local_timer_ack(void); - -/* * Stop the local timer */ void local_timer_stop(struct clock_event_device *); diff --git a/arch/arm/include/asm/smp_twd.h b/arch/arm/include/asm/smp_twd.h index 6923037..ef9ffba 100644 --- a/arch/arm/include/asm/smp_twd.h +++ b/arch/arm/include/asm/smp_twd.h @@ -22,7 +22,6 @@ struct clock_event_device; extern void __iomem *twd_base; -int twd_timer_ack(void); void twd_timer_setup(struct clock_event_device *); void twd_timer_stop(struct clock_event_device *); diff --git a/arch/arm/kernel/smp.c b/arch/arm/kernel/smp.c index 93b7c9a..5d1f2e2 100644 --- a/arch/arm/kernel/smp.c +++ b/arch/arm/kernel/smp.c @@ -469,20 +469,6 @@ static void ipi_timer(void) irq_exit(); } -#ifdef CONFIG_LOCAL_TIMERS -irqreturn_t percpu_timer_handler(int irq, void *dev_id) -{ - struct clock_event_device *evt = dev_id; - - if (local_timer_ack()) { - evt->event_handler(evt); - return IRQ_HANDLED; - } - - return IRQ_NONE; -} -#endif - #ifdef CONFIG_GENERIC_CLOCKEVENTS_BROADCAST static void smp_timer_broadcast(const struct cpumask *mask) { diff --git a/arch/arm/kernel/smp_twd.c b/arch/arm/kernel/smp_twd.c index 1bf0631..7156f09 100644 --- a/arch/arm/kernel/smp_twd.c +++ b/arch/arm/kernel/smp_twd.c @@ -65,20 +65,17 @@ static int twd_set_next_event(unsigned long evt, return 0; } -/* - * local_timer_ack: checks for a local timer interrupt. - * - * If a local timer interrupt has occurred, acknowledge and return 1. - * Otherwise, return 0. - */ -int twd_timer_ack(void) +static irqreturn_t twd_timer_handler(int irq, void *dev_id) { + struct clock_event_device *clk = dev_id; + if (__raw_readl(twd_base + TWD_TIMER_INTSTAT)) { __raw_writel(1, twd_base + TWD_TIMER_INTSTAT); - return 1; + clk->event_handler(clk); + return IRQ_HANDLED; } - return 0; + return IRQ_NONE; } void twd_timer_stop(struct clock_event_device *clk) @@ -148,7 +145,7 @@ void __cpuinit twd_timer_setup(struct clock_event_device *clk) clockevents_register_device(clk); - err = gic_request_ppi(clk->irq, percpu_timer_handler, clk); + err = gic_request_ppi(clk->irq, twd_timer_handler, clk); if (err) pr_err("%s: can't register interrupt %d on cpu %d (%d)\n", clk->name, clk->irq, smp_processor_id(), err); diff --git a/arch/arm/mach-exynos4/mct.c b/arch/arm/mach-exynos4/mct.c index 1ae059b..194fc6d 100644 --- a/arch/arm/mach-exynos4/mct.c +++ b/arch/arm/mach-exynos4/mct.c @@ -393,12 +393,6 @@ void __cpuinit local_timer_setup(struct clock_event_device *evt) { exynos4_mct_tick_init(evt); } - -int local_timer_ack(void) -{ - return 0; -} - #endif /* CONFIG_LOCAL_TIMERS */ static void __init exynos4_timer_resources(void) diff --git a/arch/arm/mach-msm/timer.c b/arch/arm/mach-msm/timer.c index 1bcdf66..94e6fc5 100644 --- a/arch/arm/mach-msm/timer.c +++ b/arch/arm/mach-msm/timer.c @@ -309,12 +309,6 @@ void local_timer_stop(struct clock_event_device *evt) evt->set_mode(CLOCK_EVT_MODE_UNUSED, evt); gic_free_ppi(evt->irq, evt); } - -inline int local_timer_ack(void) -{ - return 1; -} - #endif struct sys_timer msm_timer = {