diff options
| -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 | ||||
| -rw-r--r-- | drivers/cpufreq/cpufreq.c | 4 | ||||
| -rw-r--r-- | drivers/cpufreq/cpufreq_conservative.c | 5 | ||||
| -rw-r--r-- | drivers/cpufreq/cpufreq_ondemand.c | 5 |
6 files changed, 39 insertions, 20 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) { |
diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c index d270e8eb3e67..47d2ad0ae079 100644 --- a/drivers/cpufreq/cpufreq.c +++ b/drivers/cpufreq/cpufreq.c | |||
| @@ -1070,11 +1070,11 @@ static int __cpufreq_remove_dev(struct sys_device *sys_dev) | |||
| 1070 | spin_unlock_irqrestore(&cpufreq_driver_lock, flags); | 1070 | spin_unlock_irqrestore(&cpufreq_driver_lock, flags); |
| 1071 | #endif | 1071 | #endif |
| 1072 | 1072 | ||
| 1073 | unlock_policy_rwsem_write(cpu); | ||
| 1074 | |||
| 1073 | if (cpufreq_driver->target) | 1075 | if (cpufreq_driver->target) |
| 1074 | __cpufreq_governor(data, CPUFREQ_GOV_STOP); | 1076 | __cpufreq_governor(data, CPUFREQ_GOV_STOP); |
| 1075 | 1077 | ||
| 1076 | unlock_policy_rwsem_write(cpu); | ||
| 1077 | |||
| 1078 | kobject_put(&data->kobj); | 1078 | kobject_put(&data->kobj); |
| 1079 | 1079 | ||
| 1080 | /* we need to make sure that the underlying kobj is actually | 1080 | /* we need to make sure that the underlying kobj is actually |
diff --git a/drivers/cpufreq/cpufreq_conservative.c b/drivers/cpufreq/cpufreq_conservative.c index 2ecd95e4ab1a..7a74d175287b 100644 --- a/drivers/cpufreq/cpufreq_conservative.c +++ b/drivers/cpufreq/cpufreq_conservative.c | |||
| @@ -91,6 +91,9 @@ static unsigned int dbs_enable; /* number of CPUs using this policy */ | |||
| 91 | * (like __cpufreq_driver_target()) is being called with dbs_mutex taken, then | 91 | * (like __cpufreq_driver_target()) is being called with dbs_mutex taken, then |
| 92 | * cpu_hotplug lock should be taken before that. Note that cpu_hotplug lock | 92 | * cpu_hotplug lock should be taken before that. Note that cpu_hotplug lock |
| 93 | * is recursive for the same process. -Venki | 93 | * is recursive for the same process. -Venki |
| 94 | * DEADLOCK ALERT! (2) : do_dbs_timer() must not take the dbs_mutex, because it | ||
| 95 | * would deadlock with cancel_delayed_work_sync(), which is needed for proper | ||
| 96 | * raceless workqueue teardown. | ||
| 94 | */ | 97 | */ |
| 95 | static DEFINE_MUTEX(dbs_mutex); | 98 | static DEFINE_MUTEX(dbs_mutex); |
| 96 | 99 | ||
| @@ -542,7 +545,7 @@ static inline void dbs_timer_init(struct cpu_dbs_info_s *dbs_info) | |||
| 542 | static inline void dbs_timer_exit(struct cpu_dbs_info_s *dbs_info) | 545 | static inline void dbs_timer_exit(struct cpu_dbs_info_s *dbs_info) |
| 543 | { | 546 | { |
| 544 | dbs_info->enable = 0; | 547 | dbs_info->enable = 0; |
| 545 | cancel_delayed_work(&dbs_info->work); | 548 | cancel_delayed_work_sync(&dbs_info->work); |
| 546 | } | 549 | } |
| 547 | 550 | ||
| 548 | static int cpufreq_governor_dbs(struct cpufreq_policy *policy, | 551 | static int cpufreq_governor_dbs(struct cpufreq_policy *policy, |
diff --git a/drivers/cpufreq/cpufreq_ondemand.c b/drivers/cpufreq/cpufreq_ondemand.c index 338f428a15b7..e741c339df76 100644 --- a/drivers/cpufreq/cpufreq_ondemand.c +++ b/drivers/cpufreq/cpufreq_ondemand.c | |||
| @@ -98,6 +98,9 @@ static unsigned int dbs_enable; /* number of CPUs using this policy */ | |||
| 98 | * (like __cpufreq_driver_target()) is being called with dbs_mutex taken, then | 98 | * (like __cpufreq_driver_target()) is being called with dbs_mutex taken, then |
| 99 | * cpu_hotplug lock should be taken before that. Note that cpu_hotplug lock | 99 | * cpu_hotplug lock should be taken before that. Note that cpu_hotplug lock |
| 100 | * is recursive for the same process. -Venki | 100 | * is recursive for the same process. -Venki |
| 101 | * DEADLOCK ALERT! (2) : do_dbs_timer() must not take the dbs_mutex, because it | ||
| 102 | * would deadlock with cancel_delayed_work_sync(), which is needed for proper | ||
| 103 | * raceless workqueue teardown. | ||
| 101 | */ | 104 | */ |
| 102 | static DEFINE_MUTEX(dbs_mutex); | 105 | static DEFINE_MUTEX(dbs_mutex); |
| 103 | 106 | ||
| @@ -562,7 +565,7 @@ static inline void dbs_timer_init(struct cpu_dbs_info_s *dbs_info) | |||
| 562 | static inline void dbs_timer_exit(struct cpu_dbs_info_s *dbs_info) | 565 | static inline void dbs_timer_exit(struct cpu_dbs_info_s *dbs_info) |
| 563 | { | 566 | { |
| 564 | dbs_info->enable = 0; | 567 | dbs_info->enable = 0; |
| 565 | cancel_delayed_work(&dbs_info->work); | 568 | cancel_delayed_work_sync(&dbs_info->work); |
| 566 | } | 569 | } |
| 567 | 570 | ||
| 568 | static int cpufreq_governor_dbs(struct cpufreq_policy *policy, | 571 | static int cpufreq_governor_dbs(struct cpufreq_policy *policy, |
