2024-10-29 05:12:06 +03:00
|
|
|
From d74ce254cc470da670d6b90c69bab553cdbde62b Mon Sep 17 00:00:00 2001
|
|
|
|
From: Dhananjay Ugwekar <Dhananjay.Ugwekar@amd.com>
|
|
|
|
Date: Tue, 17 Sep 2024 09:14:35 +0000
|
|
|
|
Subject: cpufreq/amd-pstate: Rename MSR and shared memory specific functions
|
|
|
|
|
|
|
|
Existing function names "cppc_*" and "pstate_*" for shared memory and
|
|
|
|
MSR based systems are not intuitive enough, replace them with "shmem_*" and
|
|
|
|
"msr_*" respectively.
|
|
|
|
|
|
|
|
Signed-off-by: Dhananjay Ugwekar <Dhananjay.Ugwekar@amd.com>
|
|
|
|
---
|
|
|
|
drivers/cpufreq/amd-pstate.c | 24 ++++++++++++------------
|
|
|
|
1 file changed, 12 insertions(+), 12 deletions(-)
|
|
|
|
|
|
|
|
--- a/drivers/cpufreq/amd-pstate.c
|
|
|
|
+++ b/drivers/cpufreq/amd-pstate.c
|
|
|
|
@@ -263,7 +263,7 @@ static int amd_pstate_get_energy_pref_in
|
|
|
|
return index;
|
|
|
|
}
|
|
|
|
|
|
|
|
-static void pstate_update_perf(struct amd_cpudata *cpudata, u32 min_perf,
|
|
|
|
+static void msr_update_perf(struct amd_cpudata *cpudata, u32 min_perf,
|
|
|
|
u32 des_perf, u32 max_perf, bool fast_switch)
|
|
|
|
{
|
|
|
|
if (fast_switch)
|
|
|
|
@@ -273,7 +273,7 @@ static void pstate_update_perf(struct am
|
|
|
|
READ_ONCE(cpudata->cppc_req_cached));
|
|
|
|
}
|
|
|
|
|
|
|
|
-DEFINE_STATIC_CALL(amd_pstate_update_perf, pstate_update_perf);
|
|
|
|
+DEFINE_STATIC_CALL(amd_pstate_update_perf, msr_update_perf);
|
|
|
|
|
|
|
|
static inline void amd_pstate_update_perf(struct amd_cpudata *cpudata,
|
|
|
|
u32 min_perf, u32 des_perf,
|
|
|
|
@@ -336,7 +336,7 @@ static int amd_pstate_set_energy_pref_in
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
-static inline int pstate_enable(bool enable)
|
|
|
|
+static inline int msr_enable(bool enable)
|
|
|
|
{
|
|
|
|
int ret, cpu;
|
|
|
|
unsigned long logical_proc_id_mask = 0;
|
|
|
|
@@ -362,7 +362,7 @@ static inline int pstate_enable(bool ena
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
-static int cppc_enable(bool enable)
|
|
|
|
+static int shmem_enable(bool enable)
|
|
|
|
{
|
|
|
|
int cpu, ret = 0;
|
|
|
|
struct cppc_perf_ctrls perf_ctrls;
|
|
|
|
@@ -389,14 +389,14 @@ static int cppc_enable(bool enable)
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
-DEFINE_STATIC_CALL(amd_pstate_enable, pstate_enable);
|
|
|
|
+DEFINE_STATIC_CALL(amd_pstate_enable, msr_enable);
|
|
|
|
|
|
|
|
static inline int amd_pstate_enable(bool enable)
|
|
|
|
{
|
|
|
|
return static_call(amd_pstate_enable)(enable);
|
|
|
|
}
|
|
|
|
|
|
|
|
-static int pstate_init_perf(struct amd_cpudata *cpudata)
|
|
|
|
+static int msr_init_perf(struct amd_cpudata *cpudata)
|
|
|
|
{
|
|
|
|
u64 cap1;
|
|
|
|
|
|
|
|
@@ -415,7 +415,7 @@ static int pstate_init_perf(struct amd_c
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
-static int cppc_init_perf(struct amd_cpudata *cpudata)
|
|
|
|
+static int shmem_init_perf(struct amd_cpudata *cpudata)
|
|
|
|
{
|
|
|
|
struct cppc_perf_caps cppc_perf;
|
|
|
|
|
|
|
|
@@ -450,14 +450,14 @@ static int cppc_init_perf(struct amd_cpu
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
-DEFINE_STATIC_CALL(amd_pstate_init_perf, pstate_init_perf);
|
|
|
|
+DEFINE_STATIC_CALL(amd_pstate_init_perf, msr_init_perf);
|
|
|
|
|
|
|
|
static inline int amd_pstate_init_perf(struct amd_cpudata *cpudata)
|
|
|
|
{
|
|
|
|
return static_call(amd_pstate_init_perf)(cpudata);
|
|
|
|
}
|
|
|
|
|
|
|
|
-static void cppc_update_perf(struct amd_cpudata *cpudata,
|
|
|
|
+static void shmem_update_perf(struct amd_cpudata *cpudata,
|
|
|
|
u32 min_perf, u32 des_perf,
|
|
|
|
u32 max_perf, bool fast_switch)
|
|
|
|
{
|
2024-12-05 18:46:18 +03:00
|
|
|
@@ -1897,9 +1897,9 @@ static int __init amd_pstate_init(void)
|
2024-10-29 05:12:06 +03:00
|
|
|
current_pstate_driver->adjust_perf = amd_pstate_adjust_perf;
|
|
|
|
} else {
|
|
|
|
pr_debug("AMD CPPC shared memory based functionality is supported\n");
|
|
|
|
- static_call_update(amd_pstate_enable, cppc_enable);
|
|
|
|
- static_call_update(amd_pstate_init_perf, cppc_init_perf);
|
|
|
|
- static_call_update(amd_pstate_update_perf, cppc_update_perf);
|
|
|
|
+ static_call_update(amd_pstate_enable, shmem_enable);
|
|
|
|
+ static_call_update(amd_pstate_init_perf, shmem_init_perf);
|
|
|
|
+ static_call_update(amd_pstate_update_perf, shmem_update_perf);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (amd_pstate_prefcore) {
|