From patchwork Fri Jun 24 13:14:50 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marc Zyngier X-Patchwork-Id: 916202 Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by demeter1.kernel.org (8.14.4/8.14.4) with ESMTP id p5ODFC8K004644 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Fri, 24 Jun 2011 13:15: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 1Qa6Do-0006SI-Uu; Fri, 24 Jun 2011 13:14:57 +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 1Qa6Do-00059K-Kj; Fri, 24 Jun 2011 13:14:56 +0000 Received: from service87.mimecast.com ([94.185.240.25]) by canuck.infradead.org with smtp (Exim 4.76 #1 (Red Hat Linux)) id 1Qa6Dk-000591-RB for linux-arm-kernel@lists.infradead.org; Fri, 24 Jun 2011 13:14:54 +0000 Received: from cam-owa2.Emea.Arm.com (fw-tnat.cambridge.arm.com [217.140.96.21]) by service87.mimecast.com; Fri, 24 Jun 2011 14:14:47 +0100 Received: from [10.1.66.40] ([10.1.255.212]) by cam-owa2.Emea.Arm.com with Microsoft SMTPSVC(6.0.3790.3959); Fri, 24 Jun 2011 14:14:43 +0100 Message-ID: <4E048DCA.8070700@arm.com> Date: Fri, 24 Jun 2011 14:14:50 +0100 From: Marc Zyngier User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.17) Gecko/20110424 Lightning/1.0b2 Thunderbird/3.1.10 MIME-Version: 1.0 To: Linus Walleij Subject: Re: [PATCH] clocksource/arm_smp_twd: handle frequency changes References: <1308559687-30768-1-git-send-email-linus.walleij@stericsson.com> In-Reply-To: <1308559687-30768-1-git-send-email-linus.walleij@stericsson.com> X-Enigmail-Version: 1.1.2 X-OriginalArrivalTime: 24 Jun 2011 13:14:43.0355 (UTC) FILETIME=[AE93CEB0:01CC3270] X-MC-Unique: 111062414144701501 X-CRM114-Version: 20090807-BlameThorstenAndJenny ( TRE 0.7.6 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20110624_091453_140574_367DC57C X-CRM114-Status: GOOD ( 22.22 ) 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: Russell King , Arnd Bergmann , Linus Walleij , Colin Cross , Thomas Gleixner , Lee Jones , "linux-arm-kernel@lists.infradead.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: , 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, 24 Jun 2011 13:15:33 +0000 (UTC) On 20/06/11 09:48, Linus Walleij wrote: > From: Colin Cross > > First add a clock called "smp_twd" that is used to determine the > twd frequency, which can also be used at init time to avoid > calibrating the twd frequency since we already know it. > > Then the localtimer's clock changes with the cpu clock, since the > block has only one clock input. After a cpufreq transition, update > the clockevent's frequency and reprogram the next clock event > so we stay tight on the scheduled timeline. > > Clock changes are based on Rob Herring's work. > > This patch depends on the whole localtimer rewrite and move > shebang from Marc Zyngier, and that in turn depends on other > stuff. > > Signed-off-by: Colin Cross > Cc: Thomas Gleixner > Cc: Russell King > Cc: Marc Zyngier > Cc: Arnd Bergmann > Acked-by: Rob Herring > Acked-by: Santosh Shilimkar > [ifdef:ed CPUfreq stuff - rebased to Marc Z patches] > Signed-off-by: Linus Walleij > --- > Marc, if you're pursuing this series, consider merging this on top, > it is needed for the new ARM A9 small-form factor reference platform > whatever it is called. Linus, I've applied the attached patch on top of this one, just removing a now superfluous variable. No functional changes. Cheers, M. From 602dc634a0ef516b93d4b5f605e22c58a56c1b9e Mon Sep 17 00:00:00 2001 From: Marc Zyngier Date: Fri, 24 Jun 2011 14:01:41 +0100 Subject: [PATCH] ARM: clocksource/arm_smp_twd: remove superfluous per_cpu variable The twd_ce variable was used to track the per-cpu clock event devices in the previous incarnation of the driver. As these clock event devices are now directly accessible inside the driver, just get rid of it and access the real thing directly. Signed-off-by: Marc Zyngier --- drivers/clocksource/arm_smp_twd.c | 4 +--- 1 files changed, 1 insertions(+), 3 deletions(-) diff --git a/drivers/clocksource/arm_smp_twd.c b/drivers/clocksource/arm_smp_twd.c index 4d58975..65f4669 100644 --- a/drivers/clocksource/arm_smp_twd.c +++ b/drivers/clocksource/arm_smp_twd.c @@ -40,7 +40,6 @@ static void __iomem *twd_base; static int twd_ppi; static struct clk *twd_clk; -static DEFINE_PER_CPU(struct clock_event_device *, twd_ce); static unsigned long twd_timer_rate; static DEFINE_PER_CPU(bool, irq_reqd); static struct clock_event_device __percpu *twd_evt; @@ -106,7 +105,7 @@ static void twd_update_frequency(void *data) { twd_timer_rate = clk_get_rate(twd_clk); - clockevents_update_freq(__get_cpu_var(twd_ce), twd_timer_rate); + clockevents_update_freq(__get_cpu_var(twd_evt), twd_timer_rate); } static int twd_cpufreq_transition(struct notifier_block *nb, @@ -238,7 +237,6 @@ static void __cpuinit twd_setup(void *data) return; } - __get_cpu_var(twd_ce) = clk; clockevents_config_and_register(clk, twd_timer_rate, 0xf, 0xffffffff); } -- 1.7.0.4