mirror of https://gitee.com/openkylin/linux.git
cpufreq: CPPC: Avoid overflow when calculating desired_perf
This patch fixes overflow issue when calculating the desired_perf.
Fixes: ad38677df4
(cpufreq: CPPC: Force reporting values in KHz to fix user space interface)
Signed-off-by: Hoan Tran <hotran@apm.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
This commit is contained in:
parent
e01072d22d
commit
f89f4147f7
|
@ -84,7 +84,7 @@ static int cppc_cpufreq_set_target(struct cpufreq_policy *policy,
|
|||
|
||||
cpu = all_cpu_data[policy->cpu];
|
||||
|
||||
cpu->perf_ctrls.desired_perf = target_freq * policy->max / cppc_dmi_max_khz;
|
||||
cpu->perf_ctrls.desired_perf = (u64)target_freq * policy->max / cppc_dmi_max_khz;
|
||||
freqs.old = policy->cur;
|
||||
freqs.new = target_freq;
|
||||
|
||||
|
|
Loading…
Reference in New Issue