Commit 394b7fd7 authored by Rafael J. Wysocki's avatar Rafael J. Wysocki Committed by Jia, Yingbao
Browse files

cpufreq: intel_pstate: Fold intel_pstate_max_within_limits() into caller

mainline inclusion
from mainline-v6.10
commit 032c5565eb80edb6f2faeb31939540c897987119
category: bugfix
bugzilla: https://gitee.com/openeuler/intel-kernel/issues/IB6QC4
CVE: NA
Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=032c5565eb80edb6f2faeb31939540c897987119



-------------------------------------------------

Intel-SIG: commit 032c5565eb80 cpufreq: intel_pstate: Fold intel_pstate_max_within_limits() into caller.
Backport intel_pstate driver update for 6.6 from 6.11

Fold intel_pstate_max_within_limits() into its only caller.

No functional impact.

Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
Acked-by: default avatarSrinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
[ Yingbao Jia: amend commit log ]
Signed-off-by: default avatarYingbao Jia <yingbao.jia@intel.com>
parent 0e9ba053
Loading
Loading
Loading
Loading
+4 −9
Original line number Diff line number Diff line
@@ -2011,14 +2011,6 @@ static void intel_pstate_set_min_pstate(struct cpudata *cpu)
	intel_pstate_set_pstate(cpu, cpu->pstate.min_pstate);
}

static void intel_pstate_max_within_limits(struct cpudata *cpu)
{
	int pstate = max(cpu->pstate.min_pstate, cpu->max_perf_ratio);

	update_turbo_state();
	intel_pstate_set_pstate(cpu, pstate);
}

static void intel_pstate_get_cpu_pstates(struct cpudata *cpu)
{
	int perf_ctl_max_phys = pstate_funcs.get_max_physical(cpu->cpu);
@@ -2593,12 +2585,15 @@ static int intel_pstate_set_policy(struct cpufreq_policy *policy)
	intel_pstate_update_perf_limits(cpu, policy->min, policy->max);

	if (cpu->policy == CPUFREQ_POLICY_PERFORMANCE) {
		int pstate = max(cpu->pstate.min_pstate, cpu->max_perf_ratio);

		/*
		 * NOHZ_FULL CPUs need this as the governor callback may not
		 * be invoked on them.
		 */
		intel_pstate_clear_update_util_hook(policy->cpu);
		intel_pstate_max_within_limits(cpu);
		update_turbo_state();
		intel_pstate_set_pstate(cpu, pstate);
	} else {
		intel_pstate_set_update_util_hook(policy->cpu);
	}