diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-05-26 15:13:33 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-05-26 15:13:33 -0400 |
commit | 733be82e7d41b9f932118f021704b5289d527231 (patch) | |
tree | b2c78fe1436001a153f9fd1883e679916f79af43 /arch | |
parent | 564346224daaa8f7222d7a92cdbb7bafde59ae6e (diff) | |
parent | ca446d06351992e4f1a7c1e5e99870ab4ec5188f (diff) |
Merge branch 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/davej/cpufreq
* 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/davej/cpufreq:
[CPUFREQ] powernow-k8: determine exact CPU frequency for HW Pstates
[CPUFREQ] powernow-k8 cleanup msg if BIOS does not export ACPI _PSS cpufreq data
[CPUFREQ] fix timer teardown in ondemand governor
[CPUFREQ] fix timer teardown in conservative governor
[CPUFREQ] remove rwsem lock from CPUFREQ_GOV_STOP call
[CPUFREQ] powernow-k7 build fix when ACPI=n
[CPUFREQ] add atom family to p4-clockmod
Diffstat (limited to 'arch')
-rw-r--r-- | arch/x86/kernel/cpu/cpufreq/p4-clockmod.c | 1 | ||||
-rw-r--r-- | arch/x86/kernel/cpu/cpufreq/powernow-k7.c | 2 | ||||
-rw-r--r-- | arch/x86/kernel/cpu/cpufreq/powernow-k8.c | 42 |
3 files changed, 29 insertions, 16 deletions
diff --git a/arch/x86/kernel/cpu/cpufreq/p4-clockmod.c b/arch/x86/kernel/cpu/cpufreq/p4-clockmod.c index 6ac55bd341ae..869615193720 100644 --- a/arch/x86/kernel/cpu/cpufreq/p4-clockmod.c +++ b/arch/x86/kernel/cpu/cpufreq/p4-clockmod.c | |||
@@ -168,6 +168,7 @@ static unsigned int cpufreq_p4_get_frequency(struct cpuinfo_x86 *c) | |||
168 | case 0x0E: /* Core */ | 168 | case 0x0E: /* Core */ |
169 | case 0x0F: /* Core Duo */ | 169 | case 0x0F: /* Core Duo */ |
170 | case 0x16: /* Celeron Core */ | 170 | case 0x16: /* Celeron Core */ |
171 | case 0x1C: /* Atom */ | ||
171 | p4clockmod_driver.flags |= CPUFREQ_CONST_LOOPS; | 172 | p4clockmod_driver.flags |= CPUFREQ_CONST_LOOPS; |
172 | return speedstep_get_frequency(SPEEDSTEP_CPU_PCORE); | 173 | return speedstep_get_frequency(SPEEDSTEP_CPU_PCORE); |
173 | case 0x0D: /* Pentium M (Dothan) */ | 174 | case 0x0D: /* Pentium M (Dothan) */ |
diff --git a/arch/x86/kernel/cpu/cpufreq/powernow-k7.c b/arch/x86/kernel/cpu/cpufreq/powernow-k7.c index 3c28ccd49742..a8363e5be4ef 100644 --- a/arch/x86/kernel/cpu/cpufreq/powernow-k7.c +++ b/arch/x86/kernel/cpu/cpufreq/powernow-k7.c | |||
@@ -168,10 +168,12 @@ static int check_powernow(void) | |||
168 | return 1; | 168 | return 1; |
169 | } | 169 | } |
170 | 170 | ||
171 | #ifdef CONFIG_X86_POWERNOW_K7_ACPI | ||
171 | static void invalidate_entry(unsigned int entry) | 172 | static void invalidate_entry(unsigned int entry) |
172 | { | 173 | { |
173 | powernow_table[entry].frequency = CPUFREQ_ENTRY_INVALID; | 174 | powernow_table[entry].frequency = CPUFREQ_ENTRY_INVALID; |
174 | } | 175 | } |
176 | #endif | ||
175 | 177 | ||
176 | static int get_ranges(unsigned char *pst) | 178 | static int get_ranges(unsigned char *pst) |
177 | { | 179 | { |
diff --git a/arch/x86/kernel/cpu/cpufreq/powernow-k8.c b/arch/x86/kernel/cpu/cpufreq/powernow-k8.c index 4709ead2db52..f6b32d112357 100644 --- a/arch/x86/kernel/cpu/cpufreq/powernow-k8.c +++ b/arch/x86/kernel/cpu/cpufreq/powernow-k8.c | |||
@@ -649,6 +649,20 @@ static void print_basics(struct powernow_k8_data *data) | |||
649 | data->batps); | 649 | data->batps); |
650 | } | 650 | } |
651 | 651 | ||
652 | static u32 freq_from_fid_did(u32 fid, u32 did) | ||
653 | { | ||
654 | u32 mhz = 0; | ||
655 | |||
656 | if (boot_cpu_data.x86 == 0x10) | ||
657 | mhz = (100 * (fid + 0x10)) >> did; | ||
658 | else if (boot_cpu_data.x86 == 0x11) | ||
659 | mhz = (100 * (fid + 8)) >> did; | ||
660 | else | ||
661 | BUG(); | ||
662 | |||
663 | return mhz * 1000; | ||
664 | } | ||
665 | |||
652 | static int fill_powernow_table(struct powernow_k8_data *data, | 666 | static int fill_powernow_table(struct powernow_k8_data *data, |
653 | struct pst_s *pst, u8 maxvid) | 667 | struct pst_s *pst, u8 maxvid) |
654 | { | 668 | { |
@@ -923,8 +937,13 @@ static int fill_powernow_table_pstate(struct powernow_k8_data *data, | |||
923 | 937 | ||
924 | powernow_table[i].index = index; | 938 | powernow_table[i].index = index; |
925 | 939 | ||
926 | powernow_table[i].frequency = | 940 | /* Frequency may be rounded for these */ |
927 | data->acpi_data.states[i].core_frequency * 1000; | 941 | if (boot_cpu_data.x86 == 0x10 || boot_cpu_data.x86 == 0x11) { |
942 | powernow_table[i].frequency = | ||
943 | freq_from_fid_did(lo & 0x3f, (lo >> 6) & 7); | ||
944 | } else | ||
945 | powernow_table[i].frequency = | ||
946 | data->acpi_data.states[i].core_frequency * 1000; | ||
928 | } | 947 | } |
929 | return 0; | 948 | return 0; |
930 | } | 949 | } |
@@ -1215,13 +1234,16 @@ static int powernowk8_verify(struct cpufreq_policy *pol) | |||
1215 | return cpufreq_frequency_table_verify(pol, data->powernow_table); | 1234 | return cpufreq_frequency_table_verify(pol, data->powernow_table); |
1216 | } | 1235 | } |
1217 | 1236 | ||
1237 | static const char ACPI_PSS_BIOS_BUG_MSG[] = | ||
1238 | KERN_ERR FW_BUG PFX "No compatible ACPI _PSS objects found.\n" | ||
1239 | KERN_ERR FW_BUG PFX "Try again with latest BIOS.\n"; | ||
1240 | |||
1218 | /* per CPU init entry point to the driver */ | 1241 | /* per CPU init entry point to the driver */ |
1219 | static int __cpuinit powernowk8_cpu_init(struct cpufreq_policy *pol) | 1242 | static int __cpuinit powernowk8_cpu_init(struct cpufreq_policy *pol) |
1220 | { | 1243 | { |
1221 | struct powernow_k8_data *data; | 1244 | struct powernow_k8_data *data; |
1222 | cpumask_t oldmask; | 1245 | cpumask_t oldmask; |
1223 | int rc; | 1246 | int rc; |
1224 | static int print_once; | ||
1225 | 1247 | ||
1226 | if (!cpu_online(pol->cpu)) | 1248 | if (!cpu_online(pol->cpu)) |
1227 | return -ENODEV; | 1249 | return -ENODEV; |
@@ -1244,19 +1266,7 @@ static int __cpuinit powernowk8_cpu_init(struct cpufreq_policy *pol) | |||
1244 | * an UP version, and is deprecated by AMD. | 1266 | * an UP version, and is deprecated by AMD. |
1245 | */ | 1267 | */ |
1246 | if (num_online_cpus() != 1) { | 1268 | if (num_online_cpus() != 1) { |
1247 | /* | 1269 | printk_once(ACPI_PSS_BIOS_BUG_MSG); |
1248 | * Replace this one with print_once as soon as such a | ||
1249 | * thing gets introduced | ||
1250 | */ | ||
1251 | if (!print_once) { | ||
1252 | WARN_ONCE(1, KERN_ERR FW_BUG PFX "Your BIOS " | ||
1253 | "does not provide ACPI _PSS objects " | ||
1254 | "in a way that Linux understands. " | ||
1255 | "Please report this to the Linux ACPI" | ||
1256 | " maintainers and complain to your " | ||
1257 | "BIOS vendor.\n"); | ||
1258 | print_once++; | ||
1259 | } | ||
1260 | goto err_out; | 1270 | goto err_out; |
1261 | } | 1271 | } |
1262 | if (pol->cpu != 0) { | 1272 | if (pol->cpu != 0) { |