diff options
author | Thomas Renninger <trenn@suse.de> | 2009-02-03 19:17:45 -0500 |
---|---|---|
committer | Dave Jones <davej@redhat.com> | 2009-02-24 22:47:31 -0500 |
commit | 57f4fa699195b761cbea90db5e38b4bc15610c7c (patch) | |
tree | 875a995aa02e9d171a7fd384ac6813b2cc4f805f /arch | |
parent | ed12978453a3845c947695e7ad32bb3ede444813 (diff) |
[CPUFREQ] powernow-k8: Always compile powernow-k8 driver with ACPI support
powernow-k8 driver should always try to get cpufreq info from ACPI.
Otherwise it will not be able to detect the transition latency correctly
which results in ondemand governor taking a wrong sampling rate which will
then result in sever performance loss.
Let the user not shoot himself in the foot and always compile in ACPI
support for powernow-k8.
This also fixes a wrong message if ACPI_PROCESSOR is compiled as a module and
#ifndef CONFIG_ACPI_PROCESSOR
path is chosen.
Signed-off-by: Thomas Renninger <trenn@suse.de>
Signed-off-by: Dave Jones <davej@redhat.com>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/x86/kernel/cpu/cpufreq/Kconfig | 19 | ||||
-rw-r--r-- | arch/x86/kernel/cpu/cpufreq/powernow-k8.c | 28 | ||||
-rw-r--r-- | arch/x86/kernel/cpu/cpufreq/powernow-k8.h | 5 |
3 files changed, 3 insertions, 49 deletions
diff --git a/arch/x86/kernel/cpu/cpufreq/Kconfig b/arch/x86/kernel/cpu/cpufreq/Kconfig index 65792c2cc462..52c839875478 100644 --- a/arch/x86/kernel/cpu/cpufreq/Kconfig +++ b/arch/x86/kernel/cpu/cpufreq/Kconfig | |||
@@ -87,30 +87,15 @@ config X86_POWERNOW_K7_ACPI | |||
87 | config X86_POWERNOW_K8 | 87 | config X86_POWERNOW_K8 |
88 | tristate "AMD Opteron/Athlon64 PowerNow!" | 88 | tristate "AMD Opteron/Athlon64 PowerNow!" |
89 | select CPU_FREQ_TABLE | 89 | select CPU_FREQ_TABLE |
90 | depends on ACPI && ACPI_PROCESSOR | ||
90 | help | 91 | help |
91 | This adds the CPUFreq driver for mobile AMD Opteron/Athlon64 processors. | 92 | This adds the CPUFreq driver for K8/K10 Opteron/Athlon64 processors. |
92 | 93 | ||
93 | To compile this driver as a module, choose M here: the | 94 | To compile this driver as a module, choose M here: the |
94 | module will be called powernow-k8. | 95 | module will be called powernow-k8. |
95 | 96 | ||
96 | For details, take a look at <file:Documentation/cpu-freq/>. | 97 | For details, take a look at <file:Documentation/cpu-freq/>. |
97 | 98 | ||
98 | If in doubt, say N. | ||
99 | |||
100 | config X86_POWERNOW_K8_ACPI | ||
101 | bool | ||
102 | prompt "ACPI Support" if X86_32 | ||
103 | depends on ACPI && X86_POWERNOW_K8 && ACPI_PROCESSOR | ||
104 | depends on !(X86_POWERNOW_K8 = y && ACPI_PROCESSOR = m) | ||
105 | default y | ||
106 | help | ||
107 | This provides access to the K8s Processor Performance States via ACPI. | ||
108 | This driver is probably required for CPUFreq to work with multi-socket and | ||
109 | SMP systems. It is not required on at least some single-socket yet | ||
110 | multi-core systems, even if SMP is enabled. | ||
111 | |||
112 | It is safe to say Y here. | ||
113 | |||
114 | config X86_GX_SUSPMOD | 99 | config X86_GX_SUSPMOD |
115 | tristate "Cyrix MediaGX/NatSemi Geode Suspend Modulation" | 100 | tristate "Cyrix MediaGX/NatSemi Geode Suspend Modulation" |
116 | depends on X86_32 && PCI | 101 | depends on X86_32 && PCI |
diff --git a/arch/x86/kernel/cpu/cpufreq/powernow-k8.c b/arch/x86/kernel/cpu/cpufreq/powernow-k8.c index 4dd7e3bdee23..acc06b03194e 100644 --- a/arch/x86/kernel/cpu/cpufreq/powernow-k8.c +++ b/arch/x86/kernel/cpu/cpufreq/powernow-k8.c | |||
@@ -38,11 +38,9 @@ | |||
38 | 38 | ||
39 | #include <asm/msr.h> | 39 | #include <asm/msr.h> |
40 | 40 | ||
41 | #ifdef CONFIG_X86_POWERNOW_K8_ACPI | ||
42 | #include <linux/acpi.h> | 41 | #include <linux/acpi.h> |
43 | #include <linux/mutex.h> | 42 | #include <linux/mutex.h> |
44 | #include <acpi/processor.h> | 43 | #include <acpi/processor.h> |
45 | #endif | ||
46 | 44 | ||
47 | #define PFX "powernow-k8: " | 45 | #define PFX "powernow-k8: " |
48 | #define VERSION "version 2.20.00" | 46 | #define VERSION "version 2.20.00" |
@@ -800,7 +798,6 @@ static int find_psb_table(struct powernow_k8_data *data) | |||
800 | return -ENODEV; | 798 | return -ENODEV; |
801 | } | 799 | } |
802 | 800 | ||
803 | #ifdef CONFIG_X86_POWERNOW_K8_ACPI | ||
804 | static void powernow_k8_acpi_pst_values(struct powernow_k8_data *data, | 801 | static void powernow_k8_acpi_pst_values(struct powernow_k8_data *data, |
805 | unsigned int index) | 802 | unsigned int index) |
806 | { | 803 | { |
@@ -1030,23 +1027,6 @@ static int get_transition_latency(struct powernow_k8_data *data) | |||
1030 | return 1000 * max_latency; | 1027 | return 1000 * max_latency; |
1031 | } | 1028 | } |
1032 | 1029 | ||
1033 | #else | ||
1034 | static int powernow_k8_cpu_init_acpi(struct powernow_k8_data *data) | ||
1035 | { | ||
1036 | return -ENODEV; | ||
1037 | } | ||
1038 | static void powernow_k8_cpu_exit_acpi(struct powernow_k8_data *data) | ||
1039 | { | ||
1040 | return; | ||
1041 | } | ||
1042 | static void powernow_k8_acpi_pst_values(struct powernow_k8_data *data, | ||
1043 | unsigned int index) | ||
1044 | { | ||
1045 | return; | ||
1046 | } | ||
1047 | static int get_transition_latency(struct powernow_k8_data *data) { return 0; } | ||
1048 | #endif /* CONFIG_X86_POWERNOW_K8_ACPI */ | ||
1049 | |||
1050 | /* Take a frequency, and issue the fid/vid transition command */ | 1030 | /* Take a frequency, and issue the fid/vid transition command */ |
1051 | static int transition_frequency_fidvid(struct powernow_k8_data *data, | 1031 | static int transition_frequency_fidvid(struct powernow_k8_data *data, |
1052 | unsigned int index) | 1032 | unsigned int index) |
@@ -1260,19 +1240,11 @@ static int __cpuinit powernowk8_cpu_init(struct cpufreq_policy *pol) | |||
1260 | * an UP version, and is deprecated by AMD. | 1240 | * an UP version, and is deprecated by AMD. |
1261 | */ | 1241 | */ |
1262 | if (num_online_cpus() != 1) { | 1242 | if (num_online_cpus() != 1) { |
1263 | #ifndef CONFIG_ACPI_PROCESSOR | ||
1264 | printk(KERN_ERR PFX | ||
1265 | "ACPI Processor support is required for " | ||
1266 | "SMP systems but is absent. Please load the " | ||
1267 | "ACPI Processor module before starting this " | ||
1268 | "driver.\n"); | ||
1269 | #else | ||
1270 | printk(KERN_ERR FW_BUG PFX "Your BIOS does not provide" | 1243 | printk(KERN_ERR FW_BUG PFX "Your BIOS does not provide" |
1271 | " ACPI _PSS objects in a way that Linux " | 1244 | " ACPI _PSS objects in a way that Linux " |
1272 | "understands. Please report this to the Linux " | 1245 | "understands. Please report this to the Linux " |
1273 | "ACPI maintainers and complain to your BIOS " | 1246 | "ACPI maintainers and complain to your BIOS " |
1274 | "vendor.\n"); | 1247 | "vendor.\n"); |
1275 | #endif | ||
1276 | kfree(data); | 1248 | kfree(data); |
1277 | return -ENODEV; | 1249 | return -ENODEV; |
1278 | } | 1250 | } |
diff --git a/arch/x86/kernel/cpu/cpufreq/powernow-k8.h b/arch/x86/kernel/cpu/cpufreq/powernow-k8.h index 8ecc75b6c7c3..6c6698feade1 100644 --- a/arch/x86/kernel/cpu/cpufreq/powernow-k8.h +++ b/arch/x86/kernel/cpu/cpufreq/powernow-k8.h | |||
@@ -45,11 +45,10 @@ struct powernow_k8_data { | |||
45 | * frequency is in kHz */ | 45 | * frequency is in kHz */ |
46 | struct cpufreq_frequency_table *powernow_table; | 46 | struct cpufreq_frequency_table *powernow_table; |
47 | 47 | ||
48 | #ifdef CONFIG_X86_POWERNOW_K8_ACPI | ||
49 | /* the acpi table needs to be kept. it's only available if ACPI was | 48 | /* the acpi table needs to be kept. it's only available if ACPI was |
50 | * used to determine valid frequency/vid/fid states */ | 49 | * used to determine valid frequency/vid/fid states */ |
51 | struct acpi_processor_performance acpi_data; | 50 | struct acpi_processor_performance acpi_data; |
52 | #endif | 51 | |
53 | /* we need to keep track of associated cores, but let cpufreq | 52 | /* we need to keep track of associated cores, but let cpufreq |
54 | * handle hotplug events - so just point at cpufreq pol->cpus | 53 | * handle hotplug events - so just point at cpufreq pol->cpus |
55 | * structure */ | 54 | * structure */ |
@@ -222,10 +221,8 @@ static int core_frequency_transition(struct powernow_k8_data *data, u32 reqfid); | |||
222 | 221 | ||
223 | static void powernow_k8_acpi_pst_values(struct powernow_k8_data *data, unsigned int index); | 222 | static void powernow_k8_acpi_pst_values(struct powernow_k8_data *data, unsigned int index); |
224 | 223 | ||
225 | #ifdef CONFIG_X86_POWERNOW_K8_ACPI | ||
226 | static int fill_powernow_table_pstate(struct powernow_k8_data *data, struct cpufreq_frequency_table *powernow_table); | 224 | static int fill_powernow_table_pstate(struct powernow_k8_data *data, struct cpufreq_frequency_table *powernow_table); |
227 | static int fill_powernow_table_fidvid(struct powernow_k8_data *data, struct cpufreq_frequency_table *powernow_table); | 225 | static int fill_powernow_table_fidvid(struct powernow_k8_data *data, struct cpufreq_frequency_table *powernow_table); |
228 | #endif | ||
229 | 226 | ||
230 | #ifdef CONFIG_SMP | 227 | #ifdef CONFIG_SMP |
231 | static inline void define_siblings(int cpu, cpumask_t cpu_sharedcore_mask[]) | 228 | static inline void define_siblings(int cpu, cpumask_t cpu_sharedcore_mask[]) |