Skip to content

Commit

Permalink
cpufreq: CPPC: Avoid overflow when calculating desired_perf
Browse files Browse the repository at this point in the history
This patch fixes overflow issue when calculating the desired_perf.

Fixes: ad38677 (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>
  • Loading branch information
Hoan Tran authored and Rafael J. Wysocki committed Sep 16, 2016
1 parent e01072d commit f89f414
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/cpufreq/cppc_cpufreq.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit f89f414

Please sign in to comment.