Skip to content

Commit 73070a9

Browse files
dhananjay-AMDsuperm1
authored andcommitted
cpufreq/amd-pstate: Do not attempt to clear MSR_AMD_CPPC_ENABLE
MSR_AMD_CPPC_ENABLE is a write once register, i.e. attempting to clear it is futile, it will not take effect. Hence, return if disable (0) argument is passed to the msr_cppc_enable() Signed-off-by: Dhananjay Ugwekar <[email protected]> Reviewed-by: Mario Limonciello <[email protected]> Reviewed-by: Gautham R. Shenoy <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mario Limonciello <[email protected]>
1 parent 7fb463a commit 73070a9

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

drivers/cpufreq/amd-pstate.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -311,6 +311,12 @@ static inline int msr_cppc_enable(bool enable)
311311
int ret, cpu;
312312
unsigned long logical_proc_id_mask = 0;
313313

314+
/*
315+
* MSR_AMD_CPPC_ENABLE is write-once, once set it cannot be cleared.
316+
*/
317+
if (!enable)
318+
return 0;
319+
314320
if (enable == cppc_enabled)
315321
return 0;
316322

0 commit comments

Comments
 (0)