Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751622Ab1EPLSz (ORCPT ); Mon, 16 May 2011 07:18:55 -0400 Received: from na3sys009aog113.obsmtp.com ([74.125.149.209]:45022 "EHLO na3sys009aog113.obsmtp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750895Ab1EPLSy (ORCPT ); Mon, 16 May 2011 07:18:54 -0400 Message-ID: <4DD10814.1010103@ti.com> Date: Mon, 16 May 2011 16:48:44 +0530 From: Santosh Shilimkar User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.15) Gecko/20110303 Thunderbird/3.1.9 MIME-Version: 1.0 To: Thomas Gleixner CC: Colin Cross , Linus Walleij , Russell King , Srinidhi KASAGAR , Harald Gustafsson , Linus Walleij , linux-kernel@vger.kernel.org, Rickard ANDERSSON , martin persson , Varun Swara , Catalin Marinas , linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH] ARM: twd: Adjust localtimer frequency withcpufreqnotifiers References: <1290060899-9786-1-git-send-email-ccross@android.com> <4D70BE9D.4000507@stericsson.com> <4D714C17.7080102@gmail.com> <7e9fafa016bfe536ccc373fc2cc7ba61@mail.gmail.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2165 Lines: 58 On 5/14/2011 9:21 PM, Thomas Gleixner wrote: > On Fri, 13 May 2011, Colin Cross wrote: >> On Fri, May 13, 2011 at 3:02 AM, Thomas Gleixner wrote: >>> /** >>> + * clockevents_reconfigure - Reconfigure and reprogram a clock event device. >>> + * @dev: device to modify >>> + * @freq: new device frequency >>> + * @secr: guaranteed runtime conversion range in seconds >>> + * >>> + * Reconfigure and reprogram a clock event device in oneshot >>> + * mode. Must only be called from low level idle code where >>> + * interaction with hrtimers/nohz code etc. is not possible and >>> + * guaranteed not to conflict. Must be called with interrupts >>> + * disabled! >>> + * Returns 0 on success, -ETIME when the event is in the past or >>> + * -EINVAL when called with invalid parameters. >>> + */ >> We need to call this from a cpufreq notifier with interrupts disabled, >> not from idle. > > That works as well. Comments needs update. The important thing is that > neither a timer interrupt nor a hrtimer function should interfere on > that very cpu. > The new interface certainly better than the TWD PRE-SCALER method. Thanks for this Thomas. Just for my understanding, the clockevents_reconfigure() needs to be called with interrupts disabled on that CPU as part of the CPUFREQ notifiers. I assume the right place is do it in POST notifier after the CPU clock and hence TWD clock is updated. Is that right ? Since there is need to call this API in interrupt disable context, does it make sense to take care of it inside the API itself instead of relying on caller fn ? The arch's where the per CPU TWD's share clock, per-cpu clock-events should be reconfigured on all CPUs, whenever the parent(CPU) clock has changed using some thing like smp_call_function_any() etc. Is that right understanding? At least this is how I did twd pre-scaler based fn for OMAP. Regards Santosh -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/