Skip to content

Commit ff2653d

Browse files
committed
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: b427ac4 ("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>
1 parent 3ac757e commit ff2653d

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

drivers/cpufreq/amd-pstate.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1859,12 +1859,6 @@ static int __init amd_pstate_init(void)
18591859
return -ENODEV;
18601860
}
18611861

1862-
ret = amd_pstate_register_driver(cppc_state);
1863-
if (ret) {
1864-
pr_err("failed to register with return %d\n", ret);
1865-
return ret;
1866-
}
1867-
18681862
/* capability check */
18691863
if (cpu_feature_enabled(X86_FEATURE_CPPC)) {
18701864
pr_debug("AMD CPPC MSR based functionality is supported\n");
@@ -1875,6 +1869,12 @@ static int __init amd_pstate_init(void)
18751869
static_call_update(amd_pstate_update_perf, shmem_update_perf);
18761870
}
18771871

1872+
ret = amd_pstate_register_driver(cppc_state);
1873+
if (ret) {
1874+
pr_err("failed to register with return %d\n", ret);
1875+
return ret;
1876+
}
1877+
18781878
if (amd_pstate_prefcore) {
18791879
ret = amd_detect_prefcore(&amd_pstate_prefcore);
18801880
if (ret)

0 commit comments

Comments
 (0)