Skip to content

Commit 919bfa9

Browse files
kudureranganathsuperm1
authored andcommitted
cpufreq/amd-pstate: Detect preferred core support before driver registration
Booting with amd-pstate on 3rd Generation EPYC system incorrectly enabled ITMT support despite the system not supporting Preferred Core ranking. amd_pstate_init_prefcore() called during amd_pstate*_cpu_init() requires "amd_pstate_prefcore" to be set correctly however the preferred core support is detected only after driver registration which is too late. Swap the function calls around to detect preferred core support before registring the driver via amd_pstate_register_driver(). This ensures amd_pstate*_cpu_init() sees the correct value of "amd_pstate_prefcore" considering the platform support. Fixes: 279f838 ("x86/amd: Detect preferred cores in amd_get_boost_ratio_numerator()") Fixes: ff2653d ("cpufreq/amd-pstate: Move registration after static function call update") Signed-off-by: K Prateek Nayak <kprateek.nayak@amd.com> Acked-by: Mario Limonciello <mario.limonciello@amd.com> Link: https://lore.kernel.org/r/20241210032557.754-1-kprateek.nayak@amd.com Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
1 parent fac04ef commit 919bfa9

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

drivers/cpufreq/amd-pstate.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1869,18 +1869,18 @@ static int __init amd_pstate_init(void)
18691869
static_call_update(amd_pstate_update_perf, shmem_update_perf);
18701870
}
18711871

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-
18781872
if (amd_pstate_prefcore) {
18791873
ret = amd_detect_prefcore(&amd_pstate_prefcore);
18801874
if (ret)
18811875
return ret;
18821876
}
18831877

1878+
ret = amd_pstate_register_driver(cppc_state);
1879+
if (ret) {
1880+
pr_err("failed to register with return %d\n", ret);
1881+
return ret;
1882+
}
1883+
18841884
dev_root = bus_get_dev_root(&cpu_subsys);
18851885
if (dev_root) {
18861886
ret = sysfs_create_group(&dev_root->kobj, &amd_pstate_global_attr_group);

0 commit comments

Comments
 (0)