Merge branch 'pm-fixes'
* pm-fixes: cpufreq: cpufreq-cpu0: use the exact frequency for clk_set_rate() cpufreq: protect 'policy->cpus' from offlining during __gov_queue_work() acpi-cpufreq: set current frequency based on target P-State
This commit is contained in:
commit
c6617b39c3
|
@ -347,11 +347,11 @@ static u32 get_cur_val(const struct cpumask *mask)
|
|||
switch (per_cpu(acfreq_data, cpumask_first(mask))->cpu_feature) {
|
||||
case SYSTEM_INTEL_MSR_CAPABLE:
|
||||
cmd.type = SYSTEM_INTEL_MSR_CAPABLE;
|
||||
cmd.addr.msr.reg = MSR_IA32_PERF_STATUS;
|
||||
cmd.addr.msr.reg = MSR_IA32_PERF_CTL;
|
||||
break;
|
||||
case SYSTEM_AMD_MSR_CAPABLE:
|
||||
cmd.type = SYSTEM_AMD_MSR_CAPABLE;
|
||||
cmd.addr.msr.reg = MSR_AMD_PERF_STATUS;
|
||||
cmd.addr.msr.reg = MSR_AMD_PERF_CTL;
|
||||
break;
|
||||
case SYSTEM_IO_CAPABLE:
|
||||
cmd.type = SYSTEM_IO_CAPABLE;
|
||||
|
|
|
@ -45,7 +45,7 @@ static int cpu0_set_target(struct cpufreq_policy *policy,
|
|||
struct cpufreq_freqs freqs;
|
||||
struct opp *opp;
|
||||
unsigned long volt = 0, volt_old = 0, tol = 0;
|
||||
long freq_Hz;
|
||||
long freq_Hz, freq_exact;
|
||||
unsigned int index;
|
||||
int ret;
|
||||
|
||||
|
@ -60,6 +60,7 @@ static int cpu0_set_target(struct cpufreq_policy *policy,
|
|||
freq_Hz = clk_round_rate(cpu_clk, freq_table[index].frequency * 1000);
|
||||
if (freq_Hz < 0)
|
||||
freq_Hz = freq_table[index].frequency * 1000;
|
||||
freq_exact = freq_Hz;
|
||||
freqs.new = freq_Hz / 1000;
|
||||
freqs.old = clk_get_rate(cpu_clk) / 1000;
|
||||
|
||||
|
@ -98,7 +99,7 @@ static int cpu0_set_target(struct cpufreq_policy *policy,
|
|||
}
|
||||
}
|
||||
|
||||
ret = clk_set_rate(cpu_clk, freqs.new * 1000);
|
||||
ret = clk_set_rate(cpu_clk, freq_exact);
|
||||
if (ret) {
|
||||
pr_err("failed to set clock rate: %d\n", ret);
|
||||
if (cpu_reg)
|
||||
|
|
|
@ -26,6 +26,7 @@
|
|||
#include <linux/tick.h>
|
||||
#include <linux/types.h>
|
||||
#include <linux/workqueue.h>
|
||||
#include <linux/cpu.h>
|
||||
|
||||
#include "cpufreq_governor.h"
|
||||
|
||||
|
@ -180,8 +181,10 @@ void gov_queue_work(struct dbs_data *dbs_data, struct cpufreq_policy *policy,
|
|||
if (!all_cpus) {
|
||||
__gov_queue_work(smp_processor_id(), dbs_data, delay);
|
||||
} else {
|
||||
get_online_cpus();
|
||||
for_each_cpu(i, policy->cpus)
|
||||
__gov_queue_work(i, dbs_data, delay);
|
||||
put_online_cpus();
|
||||
}
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(gov_queue_work);
|
||||
|
|
Loading…
Reference in New Issue