Skip to content

Commit 8e184ac

Browse files
committed
Merge tag 'amd-pstate-v6.11-2024-06-11' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/superm1/linux
Merge amd-pstate driver updates for v6.11 from Mario Mario Limonciello: "Add support for "Fast CPPC" which allows some CPUs to operate a tighter loop for passive mode." * tag 'amd-pstate-v6.11-2024-06-11' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/superm1/linux: cpufreq: amd-pstate: change cpu freq transition delay for some models x86/cpufeatures: Add AMD FAST CPPC feature flag
2 parents db40452 + c00d476 commit 8e184ac

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

arch/x86/include/asm/cpufeatures.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -470,6 +470,7 @@
470470
#define X86_FEATURE_BHI_CTRL (21*32+ 2) /* "" BHI_DIS_S HW control available */
471471
#define X86_FEATURE_CLEAR_BHB_HW (21*32+ 3) /* "" BHI_DIS_S HW control enabled */
472472
#define X86_FEATURE_CLEAR_BHB_LOOP_ON_VMEXIT (21*32+ 4) /* "" Clear branch history at vmexit using SW loop */
473+
#define X86_FEATURE_FAST_CPPC (21*32 + 5) /* "" AMD Fast CPPC */
473474

474475
/*
475476
* BUG word(s)

arch/x86/kernel/cpu/scattered.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ static const struct cpuid_bit cpuid_bits[] = {
4545
{ X86_FEATURE_HW_PSTATE, CPUID_EDX, 7, 0x80000007, 0 },
4646
{ X86_FEATURE_CPB, CPUID_EDX, 9, 0x80000007, 0 },
4747
{ X86_FEATURE_PROC_FEEDBACK, CPUID_EDX, 11, 0x80000007, 0 },
48+
{ X86_FEATURE_FAST_CPPC, CPUID_EDX, 15, 0x80000007, 0 },
4849
{ X86_FEATURE_MBA, CPUID_EBX, 6, 0x80000008, 0 },
4950
{ X86_FEATURE_SMBA, CPUID_EBX, 2, 0x80000020, 0 },
5051
{ X86_FEATURE_BMEC, CPUID_EBX, 3, 0x80000020, 0 },

drivers/cpufreq/amd-pstate.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@
5151

5252
#define AMD_PSTATE_TRANSITION_LATENCY 20000
5353
#define AMD_PSTATE_TRANSITION_DELAY 1000
54+
#define AMD_PSTATE_FAST_CPPC_TRANSITION_DELAY 600
5455
#define CPPC_HIGHEST_PERF_PERFORMANCE 196
5556
#define CPPC_HIGHEST_PERF_DEFAULT 166
5657

@@ -849,8 +850,12 @@ static u32 amd_pstate_get_transition_delay_us(unsigned int cpu)
849850
u32 transition_delay_ns;
850851

851852
transition_delay_ns = cppc_get_transition_latency(cpu);
852-
if (transition_delay_ns == CPUFREQ_ETERNAL)
853-
return AMD_PSTATE_TRANSITION_DELAY;
853+
if (transition_delay_ns == CPUFREQ_ETERNAL) {
854+
if (cpu_feature_enabled(X86_FEATURE_FAST_CPPC))
855+
return AMD_PSTATE_FAST_CPPC_TRANSITION_DELAY;
856+
else
857+
return AMD_PSTATE_TRANSITION_DELAY;
858+
}
854859

855860
return transition_delay_ns / NSEC_PER_USEC;
856861
}

0 commit comments

Comments
 (0)