Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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

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
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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;