Skip to content

Commit c10e50a

Browse files
dhananjay-AMDsuperm1
authored andcommitted
cpufreq/amd-pstate: Fix amd_pstate mode switch on shared memory systems
While switching the driver mode between active and passive, Collaborative Processor Performance Control (CPPC) is disabled in amd_pstate_unregister_driver(). But, it is not enabled back while registering the new driver (passive or active). This leads to the new driver mode not working correctly, so enable it back in amd_pstate_register_driver(). Fixes: 3ca7bc8 ("cpufreq: amd-pstate: Add guided mode control support via sysfs") Signed-off-by: Dhananjay Ugwekar <Dhananjay.Ugwekar@amd.com> Reviewed-by: Mario Limonciello <mario.limonciello@amd.com> Link: https://lore.kernel.org/r/20241004122303.94283-1-Dhananjay.Ugwekar@amd.com Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
1 parent 8cf0b93 commit c10e50a

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

drivers/cpufreq/amd-pstate.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1201,11 +1201,21 @@ static int amd_pstate_register_driver(int mode)
12011201
return -EINVAL;
12021202

12031203
cppc_state = mode;
1204+
1205+
ret = amd_pstate_enable(true);
1206+
if (ret) {
1207+
pr_err("failed to enable cppc during amd-pstate driver registration, return %d\n",
1208+
ret);
1209+
amd_pstate_driver_cleanup();
1210+
return ret;
1211+
}
1212+
12041213
ret = cpufreq_register_driver(current_pstate_driver);
12051214
if (ret) {
12061215
amd_pstate_driver_cleanup();
12071216
return ret;
12081217
}
1218+
12091219
return 0;
12101220
}
12111221

0 commit comments

Comments
 (0)