[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <BANLkTimMSPmqD+kyz1EJUrH9sS=qWRZymw@mail.gmail.com>
Date: Mon, 16 May 2011 09:29:03 -0700
From: Colin Cross <ccross@...roid.com>
To: Thomas Gleixner <tglx@...utronix.de>
Cc: Santosh Shilimkar <santosh.shilimkar@...com>,
Russell King <linux@....linux.org.uk>,
Srinidhi KASAGAR <srinidhi.kasagar@...ricsson.com>,
Harald Gustafsson <harald.gustafsson@...csson.com>,
Linus Walleij <linus.ml.walleij@...il.com>,
Linus Walleij <linus.walleij@...aro.org>,
linux-kernel@...r.kernel.org,
Rickard ANDERSSON <rickard.andersson@...ricsson.com>,
Varun Swara <Varun.Swara@....com>,
martin persson <martin.persson@...ricsson.com>,
Catalin Marinas <catalin.marinas@....com>,
linux-arm-kernel@...ts.infradead.org
Subject: Re: [PATCH] ARM: twd: Adjust localtimer frequency withcpufreqnotifiers
On Mon, May 16, 2011 at 7:44 AM, Thomas Gleixner <tglx@...utronix.de> wrote:
> On Mon, 16 May 2011, Santosh Shilimkar wrote:
>> On 5/14/2011 9:21 PM, Thomas Gleixner wrote:
>> 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 ?
>
> Yes.
Is it safe to only call it in POST? If the frequency is increasing,
and the TWD is not updated until after the CPU frequency has changed,
it is possible for a clockevent to fire too early. Will that cause
problems, or does the clockevent code check against a clocksource to
ensure the desired time has been reached? If that is OK, it
drastically simplifies the code, because the driver only needs to know
the current TWD frequency, not predict a future TWD frequency.
>> 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 ?
>
> Hmm, no strong opinion
For SMP TWD, the caller will always be in interrupt disabled mode,
because the cpufreq notifier will get called on a random cpu, so
smp_call_function_single will be used to transition to the correct
cpu, which disables interrupts.
>> 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?
>
> Yes. If that's a common requirement we should move that to core code.
Santosh, are you suggesting the TWD be updated from the clock
framework instead of the cpufreq notifier?
I believe ARMv7 requires all CPUs to run at the same frequency, so it
would be possible to do this in the core code somewhere, but A15 has
fixed frequency counters, and all SMP Cortex-A9s I've seen use the SMP
TWD driver, so in practice this may end up being the only user.
It would be possible for the clockevent to have a flag
CLOCKEVENT_EVT_FEAT_SCALES_WITH_CPU, which registers a cpufreq
notifier, if there were any other users.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists