Commit 733be82e authored by Linus Torvalds's avatar Linus Torvalds

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
parents 56434622 ca446d06
...@@ -168,6 +168,7 @@ static unsigned int cpufreq_p4_get_frequency(struct cpuinfo_x86 *c) ...@@ -168,6 +168,7 @@ static unsigned int cpufreq_p4_get_frequency(struct cpuinfo_x86 *c)
case 0x0E: /* Core */ case 0x0E: /* Core */
case 0x0F: /* Core Duo */ case 0x0F: /* Core Duo */
case 0x16: /* Celeron Core */ case 0x16: /* Celeron Core */
case 0x1C: /* Atom */
p4clockmod_driver.flags |= CPUFREQ_CONST_LOOPS; p4clockmod_driver.flags |= CPUFREQ_CONST_LOOPS;
return speedstep_get_frequency(SPEEDSTEP_CPU_PCORE); return speedstep_get_frequency(SPEEDSTEP_CPU_PCORE);
case 0x0D: /* Pentium M (Dothan) */ case 0x0D: /* Pentium M (Dothan) */
......
...@@ -168,10 +168,12 @@ static int check_powernow(void) ...@@ -168,10 +168,12 @@ static int check_powernow(void)
return 1; return 1;
} }
#ifdef CONFIG_X86_POWERNOW_K7_ACPI
static void invalidate_entry(unsigned int entry) static void invalidate_entry(unsigned int entry)
{ {
powernow_table[entry].frequency = CPUFREQ_ENTRY_INVALID; powernow_table[entry].frequency = CPUFREQ_ENTRY_INVALID;
} }
#endif
static int get_ranges(unsigned char *pst) static int get_ranges(unsigned char *pst)
{ {
......
...@@ -649,6 +649,20 @@ static void print_basics(struct powernow_k8_data *data) ...@@ -649,6 +649,20 @@ static void print_basics(struct powernow_k8_data *data)
data->batps); data->batps);
} }
static u32 freq_from_fid_did(u32 fid, u32 did)
{
u32 mhz = 0;
if (boot_cpu_data.x86 == 0x10)
mhz = (100 * (fid + 0x10)) >> did;
else if (boot_cpu_data.x86 == 0x11)
mhz = (100 * (fid + 8)) >> did;
else
BUG();
return mhz * 1000;
}
static int fill_powernow_table(struct powernow_k8_data *data, static int fill_powernow_table(struct powernow_k8_data *data,
struct pst_s *pst, u8 maxvid) struct pst_s *pst, u8 maxvid)
{ {
...@@ -923,8 +937,13 @@ static int fill_powernow_table_pstate(struct powernow_k8_data *data, ...@@ -923,8 +937,13 @@ static int fill_powernow_table_pstate(struct powernow_k8_data *data,
powernow_table[i].index = index; powernow_table[i].index = index;
powernow_table[i].frequency = /* Frequency may be rounded for these */
data->acpi_data.states[i].core_frequency * 1000; if (boot_cpu_data.x86 == 0x10 || boot_cpu_data.x86 == 0x11) {
powernow_table[i].frequency =
freq_from_fid_did(lo & 0x3f, (lo >> 6) & 7);
} else
powernow_table[i].frequency =
data->acpi_data.states[i].core_frequency * 1000;
} }
return 0; return 0;
} }
...@@ -1215,13 +1234,16 @@ static int powernowk8_verify(struct cpufreq_policy *pol) ...@@ -1215,13 +1234,16 @@ static int powernowk8_verify(struct cpufreq_policy *pol)
return cpufreq_frequency_table_verify(pol, data->powernow_table); return cpufreq_frequency_table_verify(pol, data->powernow_table);
} }
static const char ACPI_PSS_BIOS_BUG_MSG[] =
KERN_ERR FW_BUG PFX "No compatible ACPI _PSS objects found.\n"
KERN_ERR FW_BUG PFX "Try again with latest BIOS.\n";
/* per CPU init entry point to the driver */ /* per CPU init entry point to the driver */
static int __cpuinit powernowk8_cpu_init(struct cpufreq_policy *pol) static int __cpuinit powernowk8_cpu_init(struct cpufreq_policy *pol)
{ {
struct powernow_k8_data *data; struct powernow_k8_data *data;
cpumask_t oldmask; cpumask_t oldmask;
int rc; int rc;
static int print_once;
if (!cpu_online(pol->cpu)) if (!cpu_online(pol->cpu))
return -ENODEV; return -ENODEV;
...@@ -1244,19 +1266,7 @@ static int __cpuinit powernowk8_cpu_init(struct cpufreq_policy *pol) ...@@ -1244,19 +1266,7 @@ static int __cpuinit powernowk8_cpu_init(struct cpufreq_policy *pol)
* an UP version, and is deprecated by AMD. * an UP version, and is deprecated by AMD.
*/ */
if (num_online_cpus() != 1) { if (num_online_cpus() != 1) {
/* printk_once(ACPI_PSS_BIOS_BUG_MSG);
* Replace this one with print_once as soon as such a
* thing gets introduced
*/
if (!print_once) {
WARN_ONCE(1, KERN_ERR FW_BUG PFX "Your BIOS "
"does not provide ACPI _PSS objects "
"in a way that Linux understands. "
"Please report this to the Linux ACPI"
" maintainers and complain to your "
"BIOS vendor.\n");
print_once++;
}
goto err_out; goto err_out;
} }
if (pol->cpu != 0) { if (pol->cpu != 0) {
......
...@@ -1070,11 +1070,11 @@ static int __cpufreq_remove_dev(struct sys_device *sys_dev) ...@@ -1070,11 +1070,11 @@ static int __cpufreq_remove_dev(struct sys_device *sys_dev)
spin_unlock_irqrestore(&cpufreq_driver_lock, flags); spin_unlock_irqrestore(&cpufreq_driver_lock, flags);
#endif #endif
unlock_policy_rwsem_write(cpu);
if (cpufreq_driver->target) if (cpufreq_driver->target)
__cpufreq_governor(data, CPUFREQ_GOV_STOP); __cpufreq_governor(data, CPUFREQ_GOV_STOP);
unlock_policy_rwsem_write(cpu);
kobject_put(&data->kobj); kobject_put(&data->kobj);
/* we need to make sure that the underlying kobj is actually /* we need to make sure that the underlying kobj is actually
......
...@@ -91,6 +91,9 @@ static unsigned int dbs_enable; /* number of CPUs using this policy */ ...@@ -91,6 +91,9 @@ static unsigned int dbs_enable; /* number of CPUs using this policy */
* (like __cpufreq_driver_target()) is being called with dbs_mutex taken, then * (like __cpufreq_driver_target()) is being called with dbs_mutex taken, then
* cpu_hotplug lock should be taken before that. Note that cpu_hotplug lock * cpu_hotplug lock should be taken before that. Note that cpu_hotplug lock
* is recursive for the same process. -Venki * is recursive for the same process. -Venki
* DEADLOCK ALERT! (2) : do_dbs_timer() must not take the dbs_mutex, because it
* would deadlock with cancel_delayed_work_sync(), which is needed for proper
* raceless workqueue teardown.
*/ */
static DEFINE_MUTEX(dbs_mutex); static DEFINE_MUTEX(dbs_mutex);
...@@ -542,7 +545,7 @@ static inline void dbs_timer_init(struct cpu_dbs_info_s *dbs_info) ...@@ -542,7 +545,7 @@ static inline void dbs_timer_init(struct cpu_dbs_info_s *dbs_info)
static inline void dbs_timer_exit(struct cpu_dbs_info_s *dbs_info) static inline void dbs_timer_exit(struct cpu_dbs_info_s *dbs_info)
{ {
dbs_info->enable = 0; dbs_info->enable = 0;
cancel_delayed_work(&dbs_info->work); cancel_delayed_work_sync(&dbs_info->work);
} }
static int cpufreq_governor_dbs(struct cpufreq_policy *policy, static int cpufreq_governor_dbs(struct cpufreq_policy *policy,
......
...@@ -98,6 +98,9 @@ static unsigned int dbs_enable; /* number of CPUs using this policy */ ...@@ -98,6 +98,9 @@ static unsigned int dbs_enable; /* number of CPUs using this policy */
* (like __cpufreq_driver_target()) is being called with dbs_mutex taken, then * (like __cpufreq_driver_target()) is being called with dbs_mutex taken, then
* cpu_hotplug lock should be taken before that. Note that cpu_hotplug lock * cpu_hotplug lock should be taken before that. Note that cpu_hotplug lock
* is recursive for the same process. -Venki * is recursive for the same process. -Venki
* DEADLOCK ALERT! (2) : do_dbs_timer() must not take the dbs_mutex, because it
* would deadlock with cancel_delayed_work_sync(), which is needed for proper
* raceless workqueue teardown.
*/ */
static DEFINE_MUTEX(dbs_mutex); static DEFINE_MUTEX(dbs_mutex);
...@@ -562,7 +565,7 @@ static inline void dbs_timer_init(struct cpu_dbs_info_s *dbs_info) ...@@ -562,7 +565,7 @@ static inline void dbs_timer_init(struct cpu_dbs_info_s *dbs_info)
static inline void dbs_timer_exit(struct cpu_dbs_info_s *dbs_info) static inline void dbs_timer_exit(struct cpu_dbs_info_s *dbs_info)
{ {
dbs_info->enable = 0; dbs_info->enable = 0;
cancel_delayed_work(&dbs_info->work); cancel_delayed_work_sync(&dbs_info->work);
} }
static int cpufreq_governor_dbs(struct cpufreq_policy *policy, static int cpufreq_governor_dbs(struct cpufreq_policy *policy,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment