Skip to content

Commit 971e2c8

Browse files
committed
Merge tag 'amd-pstate-v6.17-2025-09-04' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/superm1/linux
Merge amd-pstate content for 6.17 (09/04/25) from Mario Limonciello: "Fixes for regressions found from refactor around EPP handling at suspend/resume and minimum frequency while using the performance governor." * tag 'amd-pstate-v6.17-2025-09-04' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/superm1/linux: cpufreq/amd-pstate: Fix a regression leading to EPP 0 after resume cpufreq/amd-pstate: Fix setting of CPPC.min_perf in active mode for performance governor
2 parents 76eeb9b + ba3319e commit 971e2c8

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

drivers/cpufreq/amd-pstate.c

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1554,13 +1554,15 @@ static void amd_pstate_epp_cpu_exit(struct cpufreq_policy *policy)
15541554
pr_debug("CPU %d exiting\n", policy->cpu);
15551555
}
15561556

1557-
static int amd_pstate_epp_update_limit(struct cpufreq_policy *policy)
1557+
static int amd_pstate_epp_update_limit(struct cpufreq_policy *policy, bool policy_change)
15581558
{
15591559
struct amd_cpudata *cpudata = policy->driver_data;
15601560
union perf_cached perf;
15611561
u8 epp;
15621562

1563-
if (policy->min != cpudata->min_limit_freq || policy->max != cpudata->max_limit_freq)
1563+
if (policy_change ||
1564+
policy->min != cpudata->min_limit_freq ||
1565+
policy->max != cpudata->max_limit_freq)
15641566
amd_pstate_update_min_max_limit(policy);
15651567

15661568
if (cpudata->policy == CPUFREQ_POLICY_PERFORMANCE)
@@ -1584,7 +1586,7 @@ static int amd_pstate_epp_set_policy(struct cpufreq_policy *policy)
15841586

15851587
cpudata->policy = policy->policy;
15861588

1587-
ret = amd_pstate_epp_update_limit(policy);
1589+
ret = amd_pstate_epp_update_limit(policy, true);
15881590
if (ret)
15891591
return ret;
15901592

@@ -1626,13 +1628,14 @@ static int amd_pstate_suspend(struct cpufreq_policy *policy)
16261628
* min_perf value across kexec reboots. If this CPU is just resumed back without kexec,
16271629
* the limits, epp and desired perf will get reset to the cached values in cpudata struct
16281630
*/
1629-
ret = amd_pstate_update_perf(policy, perf.bios_min_perf, 0U, 0U, 0U, false);
1631+
ret = amd_pstate_update_perf(policy, perf.bios_min_perf,
1632+
FIELD_GET(AMD_CPPC_DES_PERF_MASK, cpudata->cppc_req_cached),
1633+
FIELD_GET(AMD_CPPC_MAX_PERF_MASK, cpudata->cppc_req_cached),
1634+
FIELD_GET(AMD_CPPC_EPP_PERF_MASK, cpudata->cppc_req_cached),
1635+
false);
16301636
if (ret)
16311637
return ret;
16321638

1633-
/* invalidate to ensure it's rewritten during resume */
1634-
cpudata->cppc_req_cached = 0;
1635-
16361639
/* set this flag to avoid setting core offline*/
16371640
cpudata->suspended = true;
16381641

@@ -1658,7 +1661,7 @@ static int amd_pstate_epp_resume(struct cpufreq_policy *policy)
16581661
int ret;
16591662

16601663
/* enable amd pstate from suspend state*/
1661-
ret = amd_pstate_epp_update_limit(policy);
1664+
ret = amd_pstate_epp_update_limit(policy, false);
16621665
if (ret)
16631666
return ret;
16641667

0 commit comments

Comments
 (0)