Skip to content

Commit 222caf5

Browse files
committed
Merge tag 'amd-pstate-v6.12-2024-09-04' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/superm1/linux
Merge an amd-pstate driver update for 6.12 from Mario Limonciello: "amd-pstate development for 6.12: * Validate return of any attempt to update EPP limits, which fixes the masking hardware problems." * tag 'amd-pstate-v6.12-2024-09-04' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/superm1/linux: cpufreq/amd-pstate: Catch failures for amd_pstate_epp_update_limit()
2 parents 287f97a + c3e093e commit 222caf5

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

drivers/cpufreq/amd-pstate.c

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1555,7 +1555,7 @@ static void amd_pstate_epp_cpu_exit(struct cpufreq_policy *policy)
15551555
pr_debug("CPU %d exiting\n", policy->cpu);
15561556
}
15571557

1558-
static void amd_pstate_epp_update_limit(struct cpufreq_policy *policy)
1558+
static int amd_pstate_epp_update_limit(struct cpufreq_policy *policy)
15591559
{
15601560
struct amd_cpudata *cpudata = policy->driver_data;
15611561
u32 max_perf, min_perf, min_limit_perf, max_limit_perf;
@@ -1605,7 +1605,7 @@ static void amd_pstate_epp_update_limit(struct cpufreq_policy *policy)
16051605
* This return value can only be negative for shared_memory
16061606
* systems where EPP register read/write not supported.
16071607
*/
1608-
return;
1608+
return epp;
16091609
}
16101610

16111611
if (cpudata->policy == CPUFREQ_POLICY_PERFORMANCE)
@@ -1618,12 +1618,13 @@ static void amd_pstate_epp_update_limit(struct cpufreq_policy *policy)
16181618
}
16191619

16201620
WRITE_ONCE(cpudata->cppc_req_cached, value);
1621-
amd_pstate_set_epp(cpudata, epp);
1621+
return amd_pstate_set_epp(cpudata, epp);
16221622
}
16231623

16241624
static int amd_pstate_epp_set_policy(struct cpufreq_policy *policy)
16251625
{
16261626
struct amd_cpudata *cpudata = policy->driver_data;
1627+
int ret;
16271628

16281629
if (!policy->cpuinfo.max_freq)
16291630
return -ENODEV;
@@ -1633,7 +1634,9 @@ static int amd_pstate_epp_set_policy(struct cpufreq_policy *policy)
16331634

16341635
cpudata->policy = policy->policy;
16351636

1636-
amd_pstate_epp_update_limit(policy);
1637+
ret = amd_pstate_epp_update_limit(policy);
1638+
if (ret)
1639+
return ret;
16371640

16381641
/*
16391642
* policy->cur is never updated with the amd_pstate_epp driver, but it

0 commit comments

Comments
 (0)