diff options
Diffstat (limited to 'arch/i386/kernel/cpu/cpufreq/p4-clockmod.c')
-rw-r--r-- | arch/i386/kernel/cpu/cpufreq/p4-clockmod.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/arch/i386/kernel/cpu/cpufreq/p4-clockmod.c b/arch/i386/kernel/cpu/cpufreq/p4-clockmod.c index cc73a7ae34bc..ab6504efd801 100644 --- a/arch/i386/kernel/cpu/cpufreq/p4-clockmod.c +++ b/arch/i386/kernel/cpu/cpufreq/p4-clockmod.c | |||
@@ -14,7 +14,7 @@ | |||
14 | * The author(s) of this software shall not be held liable for damages | 14 | * The author(s) of this software shall not be held liable for damages |
15 | * of any nature resulting due to the use of this software. This | 15 | * of any nature resulting due to the use of this software. This |
16 | * software is provided AS-IS with no warranties. | 16 | * software is provided AS-IS with no warranties. |
17 | * | 17 | * |
18 | * Date Errata Description | 18 | * Date Errata Description |
19 | * 20020525 N44, O17 12.5% or 25% DC causes lockup | 19 | * 20020525 N44, O17 12.5% or 25% DC causes lockup |
20 | * | 20 | * |
@@ -22,7 +22,7 @@ | |||
22 | 22 | ||
23 | #include <linux/config.h> | 23 | #include <linux/config.h> |
24 | #include <linux/kernel.h> | 24 | #include <linux/kernel.h> |
25 | #include <linux/module.h> | 25 | #include <linux/module.h> |
26 | #include <linux/init.h> | 26 | #include <linux/init.h> |
27 | #include <linux/smp.h> | 27 | #include <linux/smp.h> |
28 | #include <linux/cpufreq.h> | 28 | #include <linux/cpufreq.h> |
@@ -30,7 +30,7 @@ | |||
30 | #include <linux/cpumask.h> | 30 | #include <linux/cpumask.h> |
31 | #include <linux/sched.h> /* current / set_cpus_allowed() */ | 31 | #include <linux/sched.h> /* current / set_cpus_allowed() */ |
32 | 32 | ||
33 | #include <asm/processor.h> | 33 | #include <asm/processor.h> |
34 | #include <asm/msr.h> | 34 | #include <asm/msr.h> |
35 | #include <asm/timex.h> | 35 | #include <asm/timex.h> |
36 | 36 | ||
@@ -79,7 +79,7 @@ static int cpufreq_p4_setdc(unsigned int cpu, unsigned int newstate) | |||
79 | } else { | 79 | } else { |
80 | dprintk("CPU#%d setting duty cycle to %d%%\n", | 80 | dprintk("CPU#%d setting duty cycle to %d%%\n", |
81 | cpu, ((125 * newstate) / 10)); | 81 | cpu, ((125 * newstate) / 10)); |
82 | /* bits 63 - 5 : reserved | 82 | /* bits 63 - 5 : reserved |
83 | * bit 4 : enable/disable | 83 | * bit 4 : enable/disable |
84 | * bits 3-1 : duty cycle | 84 | * bits 3-1 : duty cycle |
85 | * bit 0 : reserved | 85 | * bit 0 : reserved |
@@ -132,7 +132,7 @@ static int cpufreq_p4_target(struct cpufreq_policy *policy, | |||
132 | } | 132 | } |
133 | 133 | ||
134 | /* run on each logical CPU, see section 13.15.3 of IA32 Intel Architecture Software | 134 | /* run on each logical CPU, see section 13.15.3 of IA32 Intel Architecture Software |
135 | * Developer's Manual, Volume 3 | 135 | * Developer's Manual, Volume 3 |
136 | */ | 136 | */ |
137 | cpus_allowed = current->cpus_allowed; | 137 | cpus_allowed = current->cpus_allowed; |
138 | 138 | ||
@@ -206,7 +206,7 @@ static unsigned int cpufreq_p4_get_frequency(struct cpuinfo_x86 *c) | |||
206 | return speedstep_get_processor_frequency(SPEEDSTEP_PROCESSOR_P4D); | 206 | return speedstep_get_processor_frequency(SPEEDSTEP_PROCESSOR_P4D); |
207 | } | 207 | } |
208 | 208 | ||
209 | 209 | ||
210 | 210 | ||
211 | static int cpufreq_p4_cpu_init(struct cpufreq_policy *policy) | 211 | static int cpufreq_p4_cpu_init(struct cpufreq_policy *policy) |
212 | { | 212 | { |
@@ -234,7 +234,7 @@ static int cpufreq_p4_cpu_init(struct cpufreq_policy *policy) | |||
234 | dprintk("has errata -- disabling frequencies lower than 2ghz\n"); | 234 | dprintk("has errata -- disabling frequencies lower than 2ghz\n"); |
235 | break; | 235 | break; |
236 | } | 236 | } |
237 | 237 | ||
238 | /* get max frequency */ | 238 | /* get max frequency */ |
239 | stock_freq = cpufreq_p4_get_frequency(c); | 239 | stock_freq = cpufreq_p4_get_frequency(c); |
240 | if (!stock_freq) | 240 | if (!stock_freq) |
@@ -244,13 +244,13 @@ static int cpufreq_p4_cpu_init(struct cpufreq_policy *policy) | |||
244 | for (i=1; (p4clockmod_table[i].frequency != CPUFREQ_TABLE_END); i++) { | 244 | for (i=1; (p4clockmod_table[i].frequency != CPUFREQ_TABLE_END); i++) { |
245 | if ((i<2) && (has_N44_O17_errata[policy->cpu])) | 245 | if ((i<2) && (has_N44_O17_errata[policy->cpu])) |
246 | p4clockmod_table[i].frequency = CPUFREQ_ENTRY_INVALID; | 246 | p4clockmod_table[i].frequency = CPUFREQ_ENTRY_INVALID; |
247 | else if (has_N60_errata[policy->cpu] && p4clockmod_table[i].frequency < 2000000) | 247 | else if (has_N60_errata[policy->cpu] && ((stock_freq * i)/8) < 2000000) |
248 | p4clockmod_table[i].frequency = CPUFREQ_ENTRY_INVALID; | 248 | p4clockmod_table[i].frequency = CPUFREQ_ENTRY_INVALID; |
249 | else | 249 | else |
250 | p4clockmod_table[i].frequency = (stock_freq * i)/8; | 250 | p4clockmod_table[i].frequency = (stock_freq * i)/8; |
251 | } | 251 | } |
252 | cpufreq_frequency_table_get_attr(p4clockmod_table, policy->cpu); | 252 | cpufreq_frequency_table_get_attr(p4clockmod_table, policy->cpu); |
253 | 253 | ||
254 | /* cpuinfo and default policy values */ | 254 | /* cpuinfo and default policy values */ |
255 | policy->governor = CPUFREQ_DEFAULT_GOVERNOR; | 255 | policy->governor = CPUFREQ_DEFAULT_GOVERNOR; |
256 | policy->cpuinfo.transition_latency = 1000000; /* assumed */ | 256 | policy->cpuinfo.transition_latency = 1000000; /* assumed */ |
@@ -262,7 +262,7 @@ static int cpufreq_p4_cpu_init(struct cpufreq_policy *policy) | |||
262 | 262 | ||
263 | static int cpufreq_p4_cpu_exit(struct cpufreq_policy *policy) | 263 | static int cpufreq_p4_cpu_exit(struct cpufreq_policy *policy) |
264 | { | 264 | { |
265 | cpufreq_frequency_table_put_attr(policy->cpu); | 265 | cpufreq_frequency_table_put_attr(policy->cpu); |
266 | return 0; | 266 | return 0; |
267 | } | 267 | } |
268 | 268 | ||
@@ -298,7 +298,7 @@ static struct freq_attr* p4clockmod_attr[] = { | |||
298 | }; | 298 | }; |
299 | 299 | ||
300 | static struct cpufreq_driver p4clockmod_driver = { | 300 | static struct cpufreq_driver p4clockmod_driver = { |
301 | .verify = cpufreq_p4_verify, | 301 | .verify = cpufreq_p4_verify, |
302 | .target = cpufreq_p4_target, | 302 | .target = cpufreq_p4_target, |
303 | .init = cpufreq_p4_cpu_init, | 303 | .init = cpufreq_p4_cpu_init, |
304 | .exit = cpufreq_p4_cpu_exit, | 304 | .exit = cpufreq_p4_cpu_exit, |
@@ -310,12 +310,12 @@ static struct cpufreq_driver p4clockmod_driver = { | |||
310 | 310 | ||
311 | 311 | ||
312 | static int __init cpufreq_p4_init(void) | 312 | static int __init cpufreq_p4_init(void) |
313 | { | 313 | { |
314 | struct cpuinfo_x86 *c = cpu_data; | 314 | struct cpuinfo_x86 *c = cpu_data; |
315 | int ret; | 315 | int ret; |
316 | 316 | ||
317 | /* | 317 | /* |
318 | * THERM_CONTROL is architectural for IA32 now, so | 318 | * THERM_CONTROL is architectural for IA32 now, so |
319 | * we can rely on the capability checks | 319 | * we can rely on the capability checks |
320 | */ | 320 | */ |
321 | if (c->x86_vendor != X86_VENDOR_INTEL) | 321 | if (c->x86_vendor != X86_VENDOR_INTEL) |