* Query: CPU Freq Framework
@ 2010-01-12 6:44 Deepak Sikri
2010-01-12 18:50 ` Dominik Brodowski
0 siblings, 1 reply; 2+ messages in thread
From: Deepak Sikri @ 2010-01-12 6:44 UTC (permalink / raw)
To: linux-pm; +Cc: armando.visconti, shiraz.hashim
[-- Attachment #1.1: Type: text/plain, Size: 396 bytes --]
Hi,
The System timer (Clock Source & ClockEvent) for our board is sharing the
clock with CPU.On changing the CPU frequency using the CPU freq governors,
we are changing the clock being fed to CPU and timers. This is affecting the
kernel time keeping as the timer frequecy has been changed. What is the
mechanism for managing this through the CPU freq/some other Linux Framework
?
Regards
Deepak
[-- Attachment #1.2: Type: text/html, Size: 463 bytes --]
[-- Attachment #2: Type: text/plain, Size: 0 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Query: CPU Freq Framework
2010-01-12 6:44 Query: CPU Freq Framework Deepak Sikri
@ 2010-01-12 18:50 ` Dominik Brodowski
0 siblings, 0 replies; 2+ messages in thread
From: Dominik Brodowski @ 2010-01-12 18:50 UTC (permalink / raw)
To: Deepak Sikri; +Cc: armando.visconti, shiraz.hashim, linux-pm
Hey,
On Tue, Jan 12, 2010 at 12:14:29PM +0530, Deepak Sikri wrote:
> The System timer (Clock Source & ClockEvent) for our board is sharing the
> clock with CPU.On changing the CPU frequency using the CPU freq governors,
> we are changing the clock being fed to CPU and timers. This is affecting the
> kernel time keeping as the timer frequecy has been changed. What is the
> mechanism for managing this through the CPU freq/some other Linux Framework
> ?
The CPUfreq framework offers CPU transition notifiers for exactly this
purpose. See e.g. this snippet from arch/x86/kernel/tsc.c:
...
cpufreq_register_notifier(&time_cpufreq_notifier_block,
CPUFREQ_TRANSITION_NOTIFIER);
...
static struct notifier_block time_cpufreq_notifier_block = {
.notifier_call = time_cpufreq_notifier
};
...
static int time_cpufreq_notifier(struct notifier_block *nb, unsigned long val,
void *data)
{
...
if ((val == CPUFREQ_PRECHANGE && freq->old < freq->new) ||
(val == CPUFREQ_POSTCHANGE && freq->old > freq->new) ||
(val == CPUFREQ_RESUMECHANGE)) {
*lpj = cpufreq_scale(loops_per_jiffy_ref, ref_freq, freq->new);
tsc_khz = cpufreq_scale(tsc_khz_ref, ref_freq, freq->new);
...
}
...
}
Hope this helps.
Best,
Dominik
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-01-12 18:50 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-01-12 6:44 Query: CPU Freq Framework Deepak Sikri
2010-01-12 18:50 ` Dominik Brodowski
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox