* [PATCH] 1/3 A dynamic cpufreq governor
@ 2003-10-25 19:54 ` Pallipadi, Venkatesh
0 siblings, 0 replies; 2+ messages in thread
From: Pallipadi, Venkatesh @ 2003-10-25 19:54 UTC (permalink / raw)
To: linux-kernel, cpufreq, Linus Torvalds, akpm
Cc: Pavel Machek, Dominik Brodowski, Nakajima, Jun
[-- Attachment #1: Type: text/plain, Size: 3173 bytes --]
ondemand1.patch - 'unit' related bugfixes in drivers.
diffstat ondemand1.patch
acpi.c | 10 ++++++++--
powernow-k7.c | 3 ++-
speedstep-centrino.c | 3 ++-
3 files changed, 12 insertions(+), 4 deletions(-)
diff -purN linux-2.6.0-test8/arch/i386/kernel/cpu/cpufreq/acpi.c
linux-2.6.0-test8-dbs/arch/i386/kernel/cpu/cpufreq/acpi.c
--- linux-2.6.0-test8/arch/i386/kernel/cpu/cpufreq/acpi.c
2003-10-17 14:42:54.000000000 -0700
+++ linux-2.6.0-test8-dbs/arch/i386/kernel/cpu/cpufreq/acpi.c
2003-10-25 13:19:03.000000000 -0700
@@ -267,8 +267,12 @@ acpi_processor_set_performance (
/* cpufreq frequency struct */
cpufreq_freqs.cpu = perf->pr->id;
- cpufreq_freqs.old = perf->states[perf->state].core_frequency;
- cpufreq_freqs.new = perf->states[state].core_frequency;
+ /*
+ * cpufreq_notifier needs to send the freq in KHz. But acpi
+ * data we have is in MHz
+ */
+ cpufreq_freqs.old = perf->states[perf->state].core_frequency *
1000;
+ cpufreq_freqs.new = perf->states[state].core_frequency * 1000;
/* notify cpufreq */
cpufreq_notify_transition(&cpufreq_freqs, CPUFREQ_PRECHANGE);
@@ -581,6 +585,8 @@ acpi_cpufreq_cpu_init (
if (perf->states[i].transition_latency >
policy->cpuinfo.transition_latency)
policy->cpuinfo.transition_latency =
perf->states[i].transition_latency;
}
+ /* policy transition latency is in terms of nS */
+ policy->cpuinfo.transition_latency *= 1000;
policy->governor = CPUFREQ_DEFAULT_GOVERNOR;
policy->cur = perf->states[pr->limit.state.px].core_frequency *
1000;
diff -purN linux-2.6.0-test8/arch/i386/kernel/cpu/cpufreq/powernow-k7.c
linux-2.6.0-test8-dbs/arch/i386/kernel/cpu/cpufreq/powernow-k7.c
--- linux-2.6.0-test8/arch/i386/kernel/cpu/cpufreq/powernow-k7.c
2003-10-17 14:42:53.000000000 -0700
+++ linux-2.6.0-test8-dbs/arch/i386/kernel/cpu/cpufreq/powernow-k7.c
2003-10-25 13:19:03.000000000 -0700
@@ -386,7 +386,8 @@ static int __init powernow_cpu_init (str
minimum_speed, maximum_speed);
policy->governor = CPUFREQ_DEFAULT_GOVERNOR;
- policy->cpuinfo.transition_latency = latency;
+ /* 'latency' is in terms of 10nS and policy latency in terms of
nS */
+ policy->cpuinfo.transition_latency = 10 * latency;
policy->cur = maximum_speed;
return cpufreq_frequency_table_cpuinfo(policy, powernow_table);
diff -purN
linux-2.6.0-test8/arch/i386/kernel/cpu/cpufreq/speedstep-centrino.c
linux-2.6.0-test8-dbs/arch/i386/kernel/cpu/cpufreq/speedstep-centrino.c
--- linux-2.6.0-test8/arch/i386/kernel/cpu/cpufreq/speedstep-centrino.c
2003-10-17 14:43:03.000000000 -0700
+++
linux-2.6.0-test8-dbs/arch/i386/kernel/cpu/cpufreq/speedstep-centrino.c
2003-10-25 13:19:03.000000000 -0700
@@ -202,7 +202,8 @@ static int centrino_cpu_init(struct cpuf
freq = get_cur_freq();
policy->governor = CPUFREQ_DEFAULT_GOVERNOR;
- policy->cpuinfo.transition_latency = 10; /* 10uS transition
latency */
+ /* 10uS - policy transition latency is in terms of nS */
+ policy->cpuinfo.transition_latency = 1000 * 10;
policy->cur = freq;
dprintk(KERN_INFO PFX "centrino_cpu_init: policy=%d
cur=%dkHz\n",
[-- Attachment #2: ondemand1.patch --]
[-- Type: application/octet-stream, Size: 2853 bytes --]
diff -purN linux-2.6.0-test8/arch/i386/kernel/cpu/cpufreq/acpi.c linux-2.6.0-test8-dbs/arch/i386/kernel/cpu/cpufreq/acpi.c
--- linux-2.6.0-test8/arch/i386/kernel/cpu/cpufreq/acpi.c 2003-10-17 14:42:54.000000000 -0700
+++ linux-2.6.0-test8-dbs/arch/i386/kernel/cpu/cpufreq/acpi.c 2003-10-25 13:19:03.000000000 -0700
@@ -267,8 +267,12 @@ acpi_processor_set_performance (
/* cpufreq frequency struct */
cpufreq_freqs.cpu = perf->pr->id;
- cpufreq_freqs.old = perf->states[perf->state].core_frequency;
- cpufreq_freqs.new = perf->states[state].core_frequency;
+ /*
+ * cpufreq_notifier needs to send the freq in KHz. But acpi
+ * data we have is in MHz
+ */
+ cpufreq_freqs.old = perf->states[perf->state].core_frequency * 1000;
+ cpufreq_freqs.new = perf->states[state].core_frequency * 1000;
/* notify cpufreq */
cpufreq_notify_transition(&cpufreq_freqs, CPUFREQ_PRECHANGE);
@@ -581,6 +585,8 @@ acpi_cpufreq_cpu_init (
if (perf->states[i].transition_latency > policy->cpuinfo.transition_latency)
policy->cpuinfo.transition_latency = perf->states[i].transition_latency;
}
+ /* policy transition latency is in terms of nS */
+ policy->cpuinfo.transition_latency *= 1000;
policy->governor = CPUFREQ_DEFAULT_GOVERNOR;
policy->cur = perf->states[pr->limit.state.px].core_frequency * 1000;
diff -purN linux-2.6.0-test8/arch/i386/kernel/cpu/cpufreq/powernow-k7.c linux-2.6.0-test8-dbs/arch/i386/kernel/cpu/cpufreq/powernow-k7.c
--- linux-2.6.0-test8/arch/i386/kernel/cpu/cpufreq/powernow-k7.c 2003-10-17 14:42:53.000000000 -0700
+++ linux-2.6.0-test8-dbs/arch/i386/kernel/cpu/cpufreq/powernow-k7.c 2003-10-25 13:19:03.000000000 -0700
@@ -386,7 +386,8 @@ static int __init powernow_cpu_init (str
minimum_speed, maximum_speed);
policy->governor = CPUFREQ_DEFAULT_GOVERNOR;
- policy->cpuinfo.transition_latency = latency;
+ /* 'latency' is in terms of 10nS and policy latency in terms of nS */
+ policy->cpuinfo.transition_latency = 10 * latency;
policy->cur = maximum_speed;
return cpufreq_frequency_table_cpuinfo(policy, powernow_table);
diff -purN linux-2.6.0-test8/arch/i386/kernel/cpu/cpufreq/speedstep-centrino.c linux-2.6.0-test8-dbs/arch/i386/kernel/cpu/cpufreq/speedstep-centrino.c
--- linux-2.6.0-test8/arch/i386/kernel/cpu/cpufreq/speedstep-centrino.c 2003-10-17 14:43:03.000000000 -0700
+++ linux-2.6.0-test8-dbs/arch/i386/kernel/cpu/cpufreq/speedstep-centrino.c 2003-10-25 13:19:03.000000000 -0700
@@ -202,7 +202,8 @@ static int centrino_cpu_init(struct cpuf
freq = get_cur_freq();
policy->governor = CPUFREQ_DEFAULT_GOVERNOR;
- policy->cpuinfo.transition_latency = 10; /* 10uS transition latency */
+ /* 10uS - policy transition latency is in terms of nS */
+ policy->cpuinfo.transition_latency = 1000 * 10;
policy->cur = freq;
dprintk(KERN_INFO PFX "centrino_cpu_init: policy=%d cur=%dkHz\n",
^ permalink raw reply [flat|nested] 2+ messages in thread
* [PATCH] 1/3 A dynamic cpufreq governor
@ 2003-10-25 19:54 ` Pallipadi, Venkatesh
0 siblings, 0 replies; 2+ messages in thread
From: Pallipadi, Venkatesh @ 2003-10-25 19:54 UTC (permalink / raw)
To: linux-kernel, cpufreq, Linus Torvalds, akpm
Cc: Nakajima, Jun, Pavel Machek, Dominik Brodowski
[-- Attachment #1: Type: text/plain, Size: 3173 bytes --]
ondemand1.patch - 'unit' related bugfixes in drivers.
diffstat ondemand1.patch
acpi.c | 10 ++++++++--
powernow-k7.c | 3 ++-
speedstep-centrino.c | 3 ++-
3 files changed, 12 insertions(+), 4 deletions(-)
diff -purN linux-2.6.0-test8/arch/i386/kernel/cpu/cpufreq/acpi.c
linux-2.6.0-test8-dbs/arch/i386/kernel/cpu/cpufreq/acpi.c
--- linux-2.6.0-test8/arch/i386/kernel/cpu/cpufreq/acpi.c
2003-10-17 14:42:54.000000000 -0700
+++ linux-2.6.0-test8-dbs/arch/i386/kernel/cpu/cpufreq/acpi.c
2003-10-25 13:19:03.000000000 -0700
@@ -267,8 +267,12 @@ acpi_processor_set_performance (
/* cpufreq frequency struct */
cpufreq_freqs.cpu = perf->pr->id;
- cpufreq_freqs.old = perf->states[perf->state].core_frequency;
- cpufreq_freqs.new = perf->states[state].core_frequency;
+ /*
+ * cpufreq_notifier needs to send the freq in KHz. But acpi
+ * data we have is in MHz
+ */
+ cpufreq_freqs.old = perf->states[perf->state].core_frequency *
1000;
+ cpufreq_freqs.new = perf->states[state].core_frequency * 1000;
/* notify cpufreq */
cpufreq_notify_transition(&cpufreq_freqs, CPUFREQ_PRECHANGE);
@@ -581,6 +585,8 @@ acpi_cpufreq_cpu_init (
if (perf->states[i].transition_latency >
policy->cpuinfo.transition_latency)
policy->cpuinfo.transition_latency =
perf->states[i].transition_latency;
}
+ /* policy transition latency is in terms of nS */
+ policy->cpuinfo.transition_latency *= 1000;
policy->governor = CPUFREQ_DEFAULT_GOVERNOR;
policy->cur = perf->states[pr->limit.state.px].core_frequency *
1000;
diff -purN linux-2.6.0-test8/arch/i386/kernel/cpu/cpufreq/powernow-k7.c
linux-2.6.0-test8-dbs/arch/i386/kernel/cpu/cpufreq/powernow-k7.c
--- linux-2.6.0-test8/arch/i386/kernel/cpu/cpufreq/powernow-k7.c
2003-10-17 14:42:53.000000000 -0700
+++ linux-2.6.0-test8-dbs/arch/i386/kernel/cpu/cpufreq/powernow-k7.c
2003-10-25 13:19:03.000000000 -0700
@@ -386,7 +386,8 @@ static int __init powernow_cpu_init (str
minimum_speed, maximum_speed);
policy->governor = CPUFREQ_DEFAULT_GOVERNOR;
- policy->cpuinfo.transition_latency = latency;
+ /* 'latency' is in terms of 10nS and policy latency in terms of
nS */
+ policy->cpuinfo.transition_latency = 10 * latency;
policy->cur = maximum_speed;
return cpufreq_frequency_table_cpuinfo(policy, powernow_table);
diff -purN
linux-2.6.0-test8/arch/i386/kernel/cpu/cpufreq/speedstep-centrino.c
linux-2.6.0-test8-dbs/arch/i386/kernel/cpu/cpufreq/speedstep-centrino.c
--- linux-2.6.0-test8/arch/i386/kernel/cpu/cpufreq/speedstep-centrino.c
2003-10-17 14:43:03.000000000 -0700
+++
linux-2.6.0-test8-dbs/arch/i386/kernel/cpu/cpufreq/speedstep-centrino.c
2003-10-25 13:19:03.000000000 -0700
@@ -202,7 +202,8 @@ static int centrino_cpu_init(struct cpuf
freq = get_cur_freq();
policy->governor = CPUFREQ_DEFAULT_GOVERNOR;
- policy->cpuinfo.transition_latency = 10; /* 10uS transition
latency */
+ /* 10uS - policy transition latency is in terms of nS */
+ policy->cpuinfo.transition_latency = 1000 * 10;
policy->cur = freq;
dprintk(KERN_INFO PFX "centrino_cpu_init: policy=%d
cur=%dkHz\n",
[-- Attachment #2: ondemand1.patch --]
[-- Type: application/octet-stream, Size: 2853 bytes --]
diff -purN linux-2.6.0-test8/arch/i386/kernel/cpu/cpufreq/acpi.c linux-2.6.0-test8-dbs/arch/i386/kernel/cpu/cpufreq/acpi.c
--- linux-2.6.0-test8/arch/i386/kernel/cpu/cpufreq/acpi.c 2003-10-17 14:42:54.000000000 -0700
+++ linux-2.6.0-test8-dbs/arch/i386/kernel/cpu/cpufreq/acpi.c 2003-10-25 13:19:03.000000000 -0700
@@ -267,8 +267,12 @@ acpi_processor_set_performance (
/* cpufreq frequency struct */
cpufreq_freqs.cpu = perf->pr->id;
- cpufreq_freqs.old = perf->states[perf->state].core_frequency;
- cpufreq_freqs.new = perf->states[state].core_frequency;
+ /*
+ * cpufreq_notifier needs to send the freq in KHz. But acpi
+ * data we have is in MHz
+ */
+ cpufreq_freqs.old = perf->states[perf->state].core_frequency * 1000;
+ cpufreq_freqs.new = perf->states[state].core_frequency * 1000;
/* notify cpufreq */
cpufreq_notify_transition(&cpufreq_freqs, CPUFREQ_PRECHANGE);
@@ -581,6 +585,8 @@ acpi_cpufreq_cpu_init (
if (perf->states[i].transition_latency > policy->cpuinfo.transition_latency)
policy->cpuinfo.transition_latency = perf->states[i].transition_latency;
}
+ /* policy transition latency is in terms of nS */
+ policy->cpuinfo.transition_latency *= 1000;
policy->governor = CPUFREQ_DEFAULT_GOVERNOR;
policy->cur = perf->states[pr->limit.state.px].core_frequency * 1000;
diff -purN linux-2.6.0-test8/arch/i386/kernel/cpu/cpufreq/powernow-k7.c linux-2.6.0-test8-dbs/arch/i386/kernel/cpu/cpufreq/powernow-k7.c
--- linux-2.6.0-test8/arch/i386/kernel/cpu/cpufreq/powernow-k7.c 2003-10-17 14:42:53.000000000 -0700
+++ linux-2.6.0-test8-dbs/arch/i386/kernel/cpu/cpufreq/powernow-k7.c 2003-10-25 13:19:03.000000000 -0700
@@ -386,7 +386,8 @@ static int __init powernow_cpu_init (str
minimum_speed, maximum_speed);
policy->governor = CPUFREQ_DEFAULT_GOVERNOR;
- policy->cpuinfo.transition_latency = latency;
+ /* 'latency' is in terms of 10nS and policy latency in terms of nS */
+ policy->cpuinfo.transition_latency = 10 * latency;
policy->cur = maximum_speed;
return cpufreq_frequency_table_cpuinfo(policy, powernow_table);
diff -purN linux-2.6.0-test8/arch/i386/kernel/cpu/cpufreq/speedstep-centrino.c linux-2.6.0-test8-dbs/arch/i386/kernel/cpu/cpufreq/speedstep-centrino.c
--- linux-2.6.0-test8/arch/i386/kernel/cpu/cpufreq/speedstep-centrino.c 2003-10-17 14:43:03.000000000 -0700
+++ linux-2.6.0-test8-dbs/arch/i386/kernel/cpu/cpufreq/speedstep-centrino.c 2003-10-25 13:19:03.000000000 -0700
@@ -202,7 +202,8 @@ static int centrino_cpu_init(struct cpuf
freq = get_cur_freq();
policy->governor = CPUFREQ_DEFAULT_GOVERNOR;
- policy->cpuinfo.transition_latency = 10; /* 10uS transition latency */
+ /* 10uS - policy transition latency is in terms of nS */
+ policy->cpuinfo.transition_latency = 1000 * 10;
policy->cur = freq;
dprintk(KERN_INFO PFX "centrino_cpu_init: policy=%d cur=%dkHz\n",
[-- Attachment #3: Type: text/plain, Size: 143 bytes --]
_______________________________________________
Cpufreq mailing list
Cpufreq@www.linux.org.uk
http://www.linux.org.uk/mailman/listinfo/cpufreq
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2003-10-25 19:54 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-10-25 19:54 [PATCH] 1/3 A dynamic cpufreq governor Pallipadi, Venkatesh
2003-10-25 19:54 ` Pallipadi, Venkatesh
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.