Commit f89f4147 authored by Hoan Tran's avatar Hoan Tran Committed by Rafael J. Wysocki

cpufreq: CPPC: Avoid overflow when calculating desired_perf

This patch fixes overflow issue when calculating the desired_perf.

Fixes: ad38677d (cpufreq: CPPC: Force reporting values in KHz to fix user space interface)
Signed-off-by: default avatarHoan Tran <hotran@apm.com>
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
parent e01072d2
...@@ -84,7 +84,7 @@ static int cppc_cpufreq_set_target(struct cpufreq_policy *policy, ...@@ -84,7 +84,7 @@ static int cppc_cpufreq_set_target(struct cpufreq_policy *policy,
cpu = all_cpu_data[policy->cpu]; 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.old = policy->cur;
freqs.new = target_freq; freqs.new = target_freq;
......
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