diff options
author | Mario Limonciello <mario.limonciello@amd.com> | 2024-10-28 09:55:42 -0500 |
---|---|---|
committer | Mario Limonciello <mario.limonciello@amd.com> | 2024-10-29 08:50:39 -0500 |
commit | ff2653ded4d99b709f62f35656d976c47a7aa476 (patch) | |
tree | 96db4860d293066deb911809565a9d5aeb5f0056 /drivers/cpufreq | |
parent | 3ac757e8db3deacc8058912d55efd1390f985d80 (diff) | |
download | lwn-ff2653ded4d99b709f62f35656d976c47a7aa476.tar.gz lwn-ff2653ded4d99b709f62f35656d976c47a7aa476.zip |
cpufreq/amd-pstate: Move registration after static function call update
On shared memory designs the static functions need to work before
registration is done or the system can hang at bootup.
Move the registration later in amd_pstate_init() to solve this.
Fixes: b427ac408475 ("cpufreq/amd-pstate: Remove the redundant amd_pstate_set_driver() call")
Reported-by: Klara Modin <klarasmodin@gmail.com>
Closes: https://lore.kernel.org/linux-pm/cf9c146d-bacf-444e-92e2-15ebf513af96@gmail.com/#t
Tested-by: Klara Modin <klarasmodin@gmail.com>
Tested-by: Dhananjay Ugwekar <dhananjay.ugwekar@amd.com>
Link: https://lore.kernel.org/r/20241028145542.1739160-2-superm1@kernel.org
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Diffstat (limited to 'drivers/cpufreq')
-rw-r--r-- | drivers/cpufreq/amd-pstate.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/cpufreq/amd-pstate.c b/drivers/cpufreq/amd-pstate.c index e480da818d6f..f834cc8205e2 100644 --- a/drivers/cpufreq/amd-pstate.c +++ b/drivers/cpufreq/amd-pstate.c @@ -1859,12 +1859,6 @@ static int __init amd_pstate_init(void) return -ENODEV; } - ret = amd_pstate_register_driver(cppc_state); - if (ret) { - pr_err("failed to register with return %d\n", ret); - return ret; - } - /* capability check */ if (cpu_feature_enabled(X86_FEATURE_CPPC)) { pr_debug("AMD CPPC MSR based functionality is supported\n"); @@ -1875,6 +1869,12 @@ static int __init amd_pstate_init(void) static_call_update(amd_pstate_update_perf, shmem_update_perf); } + ret = amd_pstate_register_driver(cppc_state); + if (ret) { + pr_err("failed to register with return %d\n", ret); + return ret; + } + if (amd_pstate_prefcore) { ret = amd_detect_prefcore(&amd_pstate_prefcore); if (ret) |