Skip to content

Commit b3cc5af

Browse files
committed
Merge tag 'amd-pstate-v6.14-2025-02-06' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/superm1/linux
Merge amd-pstate driver fixes for 6.14-rc2 from Mario Limonciello: "* Fix some error cleanup paths with mutex use and boost * Fix a ref counting issue * Fix a schedutil issue" * tag 'amd-pstate-v6.14-2025-02-06' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/superm1/linux: cpufreq/amd-pstate: Fix cpufreq_policy ref counting cpufreq/amd-pstate: Fix max_perf updation with schedutil cpufreq/amd-pstate: Remove the goto label in amd_pstate_update_limits cpufreq/amd-pstate: Fix per-policy boost flag incorrect when fail
2 parents 0813fd2 + 3ace200 commit b3cc5af

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

drivers/cpufreq/amd-pstate.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -699,7 +699,7 @@ static void amd_pstate_adjust_perf(unsigned int cpu,
699699
if (min_perf < lowest_nonlinear_perf)
700700
min_perf = lowest_nonlinear_perf;
701701

702-
max_perf = cap_perf;
702+
max_perf = cpudata->max_limit_perf;
703703
if (max_perf < min_perf)
704704
max_perf = min_perf;
705705

@@ -747,7 +747,6 @@ static int amd_pstate_set_boost(struct cpufreq_policy *policy, int state)
747747
guard(mutex)(&amd_pstate_driver_lock);
748748

749749
ret = amd_pstate_cpu_boost_update(policy, state);
750-
policy->boost_enabled = !ret ? state : false;
751750
refresh_frequency_limits(policy);
752751

753752
return ret;
@@ -822,25 +821,28 @@ static void amd_pstate_init_prefcore(struct amd_cpudata *cpudata)
822821

823822
static void amd_pstate_update_limits(unsigned int cpu)
824823
{
825-
struct cpufreq_policy *policy = cpufreq_cpu_get(cpu);
824+
struct cpufreq_policy *policy = NULL;
826825
struct amd_cpudata *cpudata;
827826
u32 prev_high = 0, cur_high = 0;
828827
int ret;
829828
bool highest_perf_changed = false;
830829

830+
if (!amd_pstate_prefcore)
831+
return;
832+
833+
policy = cpufreq_cpu_get(cpu);
831834
if (!policy)
832835
return;
833836

834837
cpudata = policy->driver_data;
835838

836-
if (!amd_pstate_prefcore)
837-
return;
838-
839839
guard(mutex)(&amd_pstate_driver_lock);
840840

841841
ret = amd_get_highest_perf(cpu, &cur_high);
842-
if (ret)
843-
goto free_cpufreq_put;
842+
if (ret) {
843+
cpufreq_cpu_put(policy);
844+
return;
845+
}
844846

845847
prev_high = READ_ONCE(cpudata->prefcore_ranking);
846848
highest_perf_changed = (prev_high != cur_high);
@@ -850,8 +852,6 @@ static void amd_pstate_update_limits(unsigned int cpu)
850852
if (cur_high < CPPC_MAX_PERF)
851853
sched_set_itmt_core_prio((int)cur_high, cpu);
852854
}
853-
854-
free_cpufreq_put:
855855
cpufreq_cpu_put(policy);
856856

857857
if (!highest_perf_changed)

0 commit comments

Comments
 (0)