1
0
Fork 0
mirror of synced 2025-03-06 20:59:54 +01:00

amd-pstate fixes 2/6/25

* Fix some error cleanup paths with mutex use and boost
 * Fix a ref counting issue
 * Fix a schedutil issue
 -----BEGIN PGP SIGNATURE-----
 
 iQJOBAABCgA4FiEECwtuSU6dXvs5GA2aLRkspiR3AnYFAmelDV8aHG1hcmlvLmxp
 bW9uY2llbGxvQGFtZC5jb20ACgkQLRkspiR3Anbo3g/+IiTRN6zM+LfsdbHKNFzx
 X7ksJYlUPIPyF/osIUMuWvphQRucd5NEB44kaM60Iwc+2xcQmZFTL8DadIDEbYKY
 0y+Qm9bPPYWTDUrczSwqoYrGU5XP7jWFbtIt6HVfBhiFshL1w0kbj4c7VSxRBI4h
 vzMHu2WWE+qJ2520gCMXXlhQy5bu7o3VG+qNQexl32/VnZWCTeFp2G+DKzBZ61sL
 hLlXdgokNrR2MIHtEKZG9mMQ6Vvuov/P8d4D6I2wtYKc2I7JMdJd/tjIOdvjraAi
 7P9+MOnfGyUejG6m6k6u0bxDR+kWCGQXbZ+JRBJoTdDSI1STyxq4i2UoTFBHQ2M+
 xOnGOHFKWyN8OXvRIAhdnfAKTqrIn/wOSxsMMI3/d1yvFkV7CFG79R1hpipVMSxx
 WPi9a03mMP9nzt+3MsAu0O7Ma1F6RKe5O4rwDsbIueMZAbkEp54DRJq+mJEeqiEW
 mZffJOMkz+XzpEAZ4fCzHjOA09FLu0KnJclBUOzlWVZr+Dyt9dP+k8mNiBJSUoWO
 uxKMz7lwC/2Z0zSVJWnMMN66tkkhrCXg2PM9/Akx74UEmHaODUJHrRxam+SoMXta
 y1KCIXmNoNHnvPjWEE2H+TjBwVKjB4h22GpyRmpaTD/z968jUXLFcZGmgntryRWS
 NfDVzBVrCHOKix8ohNF9IO4=
 =xfUQ
 -----END PGP SIGNATURE-----

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
This commit is contained in:
Rafael J. Wysocki 2025-02-06 20:39:43 +01:00
commit b3cc5afc4d

View file

@ -699,7 +699,7 @@ static void amd_pstate_adjust_perf(unsigned int cpu,
if (min_perf < lowest_nonlinear_perf)
min_perf = lowest_nonlinear_perf;
max_perf = cap_perf;
max_perf = cpudata->max_limit_perf;
if (max_perf < min_perf)
max_perf = min_perf;
@ -747,7 +747,6 @@ static int amd_pstate_set_boost(struct cpufreq_policy *policy, int state)
guard(mutex)(&amd_pstate_driver_lock);
ret = amd_pstate_cpu_boost_update(policy, state);
policy->boost_enabled = !ret ? state : false;
refresh_frequency_limits(policy);
return ret;
@ -822,25 +821,28 @@ static void amd_pstate_init_prefcore(struct amd_cpudata *cpudata)
static void amd_pstate_update_limits(unsigned int cpu)
{
struct cpufreq_policy *policy = cpufreq_cpu_get(cpu);
struct cpufreq_policy *policy = NULL;
struct amd_cpudata *cpudata;
u32 prev_high = 0, cur_high = 0;
int ret;
bool highest_perf_changed = false;
if (!amd_pstate_prefcore)
return;
policy = cpufreq_cpu_get(cpu);
if (!policy)
return;
cpudata = policy->driver_data;
if (!amd_pstate_prefcore)
return;
guard(mutex)(&amd_pstate_driver_lock);
ret = amd_get_highest_perf(cpu, &cur_high);
if (ret)
goto free_cpufreq_put;
if (ret) {
cpufreq_cpu_put(policy);
return;
}
prev_high = READ_ONCE(cpudata->prefcore_ranking);
highest_perf_changed = (prev_high != cur_high);
@ -850,8 +852,6 @@ static void amd_pstate_update_limits(unsigned int cpu)
if (cur_high < CPPC_MAX_PERF)
sched_set_itmt_core_prio((int)cur_high, cpu);
}
free_cpufreq_put:
cpufreq_cpu_put(policy);
if (!highest_perf_changed)