]> www.infradead.org Git - users/jedix/linux-maple.git/commit
cpufreq/amd-pstate: Convert the amd_pstate_get/set_epp() to static calls
authorDhananjay Ugwekar <Dhananjay.Ugwekar@amd.com>
Wed, 4 Dec 2024 14:48:38 +0000 (14:48 +0000)
committerMario Limonciello <mario.limonciello@amd.com>
Wed, 11 Dec 2024 16:44:52 +0000 (10:44 -0600)
commit16c977f8177f9c2ecb88319c944722107c952731
tree4cd17a9e47f84d9249bbc8b87142aaf362f051cd
parent2993b29b2a98f2bc9d55dfd37ef39f56a2908748
cpufreq/amd-pstate: Convert the amd_pstate_get/set_epp() to static calls

MSR and shared memory based systems have different mechanisms to get and
set the epp value. Split those mechanisms into different functions and
assign them appropriately to the static calls at boot time. This eliminates
the need for the "if(cpu_feature_enabled(X86_FEATURE_CPPC))" checks at
runtime.

Also, propagate the error code from rdmsrl_on_cpu() and cppc_get_epp_perf()
to *_get_epp()'s caller, instead of returning -EIO unconditionally.

Signed-off-by: Dhananjay Ugwekar <Dhananjay.Ugwekar@amd.com>
Reviewed-by: Mario Limonciello <mario.limonciello@amd.com>
Reviewed-by: Gautham R. Shenoy <gautham.shenoy@amd.com>
Link: https://lore.kernel.org/r/20241204144842.164178-2-Dhananjay.Ugwekar@amd.com
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
drivers/cpufreq/amd-pstate.c