From patchwork Thu Jul 19 15:19:52 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Austin X-Patchwork-Id: 1217811 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork1.kernel.org (Postfix) with ESMTP id 7BAA53FC5A for ; Thu, 19 Jul 2012 15:39:54 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1Srsir-0005SV-SU; Thu, 19 Jul 2012 15:33:02 +0000 Received: from service87.mimecast.com ([91.220.42.44]) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1SrsWQ-0002ir-5P for linux-arm-kernel@lists.infradead.org; Thu, 19 Jul 2012 15:20:14 +0000 Received: from cam-owa1.Emea.Arm.com (fw-tnat.cambridge.arm.com [217.140.96.21]) by service87.mimecast.com; Thu, 19 Jul 2012 16:19:53 +0100 Received: from [10.1.68.61] ([10.1.255.212]) by cam-owa1.Emea.Arm.com with Microsoft SMTPSVC(6.0.3790.0); Thu, 19 Jul 2012 16:21:07 +0100 Message-ID: <50082598.5090706@arm.com> Date: Thu, 19 Jul 2012 16:19:52 +0100 From: Jonathan Austin User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.28) Gecko/20120313 Lightning/1.0b2 Thunderbird/3.1.20 MIME-Version: 1.0 To: Will Deacon Subject: Re: [PATCH v2 2/2] ARM: delay: allow timer-based delay implementation to be selected References: <20120712084432.GA2816@mudshark.cambridge.arm.com> <4FFE9A69.3060301@renesas.com> <4FFEFDE3.5000403@codeaurora.org> <4FFF8509.2050302@renesas.com> <20120713085746.GA18079@mudshark.cambridge.arm.com> <20120713111337.GH18079@mudshark.cambridge.arm.com> <5004D78E.4050606@renesas.com> <5005176C.6050904@renesas.com> <20120718175233.GB16928@mudshark.cambridge.arm.com> In-Reply-To: <20120718175233.GB16928@mudshark.cambridge.arm.com> X-OriginalArrivalTime: 19 Jul 2012 15:21:07.0169 (UTC) FILETIME=[1E663D10:01CD65C2] X-MC-Unique: 112071916195303801 X-Spam-Note: CRM114 invocation failed X-Spam-Score: -2.6 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.6 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [91.220.42.44 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: Shinya Kuribayashi , "santosh.shilimkar@ti.com" , "sboyd@codeaurora.org" , "linux-arm-kernel@lists.infradead.org" X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 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 Hi all, On 18/07/12 18:52, Will Deacon wrote: > Hello, > On Tue, Jul 17, 2012 at 08:42:36AM +0100, Shinya Kuribayashi wrote: >> On 7/17/2012 3:11 PM, Shilimkar, Santosh wrote: >>> Looks like you have a working patch for the clock detection. Will >>> you able to post that patch so that this long pending calibration >>> for secondary CPUs gets optimized. >> >> Something like this should work (not even build tested, can be applied >> on top of Will's v2 patchset): > > [...] > >> And change your ->timer() func (called via time_init) to make use of it: >> >> unsigned long freq; >> >> /* For UP/SMP systems */ >> freq = get_CPU_frequency(); >> calibrate_delay_early(freq); >> >> #ifdef CONFIG_SMP >> /* For SMP systems */ >> freq = get_Timer_frequency(); >> init_current_timer_delay(freq); >> #endif > > Since this seems to be gaining some traction on platforms without the > architected timers, Jonny and I have put together a simple registration > mechanism for the delay timer to avoid people calling init_current_timer_delay > (and defining the global read_current_timer symbol). We should probably also ignore and additional registration calls, not just those made after the delay loop has been calibrated... Something like the patch below should do the trick. Jonny -----8<------ diff --git a/arch/arm/lib/delay.c b/arch/arm/lib/delay.c index 1b51570..fff305b 100644 --- a/arch/arm/lib/delay.c +++ b/arch/arm/lib/delay.c @@ -72,8 +72,9 @@ void __init register_current_timer_delay(struct delay_timer *timer) arm_delay_ops.delay = __timer_delay; arm_delay_ops.const_udelay = __timer_const_udelay; arm_delay_ops.udelay = __timer_udelay; + delay_calibrated = true; } else { - pr_info("Ignoring late registration of read_current_timer delay\n"); + pr_info("Ignoring duplicate/late registration of read_current_timer delay\n"); } }