Skip to content

Commit 53ec210

Browse files
dhananjay-AMDsuperm1
authored andcommitted
cpufreq/amd-pstate: Merge amd_pstate_epp_cpu_offline() and amd_pstate_epp_offline()
amd_pstate_epp_offline() is only called from within amd_pstate_epp_cpu_offline() and doesn't make much sense to have it at all. Hence, remove it. Also remove the unncessary debug print in the offline path while at it. Signed-off-by: Dhananjay Ugwekar <Dhananjay.Ugwekar@amd.com> Reviewed-by: Gautham R. Shenoy <gautham.shenoy@amd.com> Reviewed-by: Mario Limonciello <mario.limonciello@amd.com> Link: https://lore.kernel.org/r/20241204144842.164178-6-Dhananjay.Ugwekar@amd.com Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
1 parent b78f8c8 commit 53ec210

File tree

1 file changed

+4
-13
lines changed

1 file changed

+4
-13
lines changed

drivers/cpufreq/amd-pstate.c

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1657,11 +1657,14 @@ static int amd_pstate_epp_cpu_online(struct cpufreq_policy *policy)
16571657
return 0;
16581658
}
16591659

1660-
static void amd_pstate_epp_offline(struct cpufreq_policy *policy)
1660+
static int amd_pstate_epp_cpu_offline(struct cpufreq_policy *policy)
16611661
{
16621662
struct amd_cpudata *cpudata = policy->driver_data;
16631663
int min_perf;
16641664

1665+
if (cpudata->suspended)
1666+
return 0;
1667+
16651668
min_perf = READ_ONCE(cpudata->lowest_perf);
16661669

16671670
mutex_lock(&amd_pstate_limits_lock);
@@ -1670,18 +1673,6 @@ static void amd_pstate_epp_offline(struct cpufreq_policy *policy)
16701673
amd_pstate_set_epp(cpudata, AMD_CPPC_EPP_BALANCE_POWERSAVE);
16711674

16721675
mutex_unlock(&amd_pstate_limits_lock);
1673-
}
1674-
1675-
static int amd_pstate_epp_cpu_offline(struct cpufreq_policy *policy)
1676-
{
1677-
struct amd_cpudata *cpudata = policy->driver_data;
1678-
1679-
pr_debug("AMD CPU Core %d going offline\n", cpudata->cpu);
1680-
1681-
if (cpudata->suspended)
1682-
return 0;
1683-
1684-
amd_pstate_epp_offline(policy);
16851676

16861677
return 0;
16871678
}

0 commit comments

Comments
 (0)