Skip to content

Commit 42c74f6

Browse files
spandruvadarafaeljw
authored andcommitted
cpufreq: intel_pstate: Remove EPB-related code
The intel_pstate driver does not enable HWP mode when CPUID.06H:EAX[10] is not set, indicating that EPP (Energy Performance Preference) is not supported by the hardware. When EPP is unavailable, the system falls back to using EPB (Energy Performance Bias) if the feature is supported. However, since the intel_pstate driver will not enable HWP in this scenario, any EPB-related code becomes unreachable and irrelevant. Remove the EPB handling code paths simplifying the driver logic and reducing code size. Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Link: https://patch.msgid.link/20250904000608.260817-1-srinivas.pandruvada@linux.intel.com [ rjw: Subject adjustment ] Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
1 parent 5f2ec35 commit 42c74f6

1 file changed

Lines changed: 4 additions & 45 deletions

File tree

drivers/cpufreq/intel_pstate.c

Lines changed: 4 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -620,24 +620,9 @@ static int min_perf_pct_min(void)
620620
(cpu->pstate.min_pstate * 100 / turbo_pstate) : 0;
621621
}
622622

623-
static s16 intel_pstate_get_epb(struct cpudata *cpu_data)
624-
{
625-
u64 epb;
626-
int ret;
627-
628-
if (!boot_cpu_has(X86_FEATURE_EPB))
629-
return -ENXIO;
630-
631-
ret = rdmsrq_on_cpu(cpu_data->cpu, MSR_IA32_ENERGY_PERF_BIAS, &epb);
632-
if (ret)
633-
return (s16)ret;
634-
635-
return (s16)(epb & 0x0f);
636-
}
637-
638623
static s16 intel_pstate_get_epp(struct cpudata *cpu_data, u64 hwp_req_data)
639624
{
640-
s16 epp;
625+
s16 epp = -EOPNOTSUPP;
641626

642627
if (boot_cpu_has(X86_FEATURE_HWP_EPP)) {
643628
/*
@@ -651,34 +636,13 @@ static s16 intel_pstate_get_epp(struct cpudata *cpu_data, u64 hwp_req_data)
651636
return epp;
652637
}
653638
epp = (hwp_req_data >> 24) & 0xff;
654-
} else {
655-
/* When there is no EPP present, HWP uses EPB settings */
656-
epp = intel_pstate_get_epb(cpu_data);
657639
}
658640

659641
return epp;
660642
}
661643

662-
static int intel_pstate_set_epb(int cpu, s16 pref)
663-
{
664-
u64 epb;
665-
int ret;
666-
667-
if (!boot_cpu_has(X86_FEATURE_EPB))
668-
return -ENXIO;
669-
670-
ret = rdmsrq_on_cpu(cpu, MSR_IA32_ENERGY_PERF_BIAS, &epb);
671-
if (ret)
672-
return ret;
673-
674-
epb = (epb & ~0x0f) | pref;
675-
wrmsrq_on_cpu(cpu, MSR_IA32_ENERGY_PERF_BIAS, epb);
676-
677-
return 0;
678-
}
679-
680644
/*
681-
* EPP/EPB display strings corresponding to EPP index in the
645+
* EPP display strings corresponding to EPP index in the
682646
* energy_perf_strings[]
683647
* index String
684648
*-------------------------------------
@@ -782,7 +746,7 @@ static int intel_pstate_set_energy_pref_index(struct cpudata *cpu_data,
782746
u32 raw_epp)
783747
{
784748
int epp = -EINVAL;
785-
int ret;
749+
int ret = -EOPNOTSUPP;
786750

787751
if (!pref_index)
788752
epp = cpu_data->epp_default;
@@ -802,10 +766,6 @@ static int intel_pstate_set_energy_pref_index(struct cpudata *cpu_data,
802766
return -EBUSY;
803767

804768
ret = intel_pstate_set_epp(cpu_data, epp);
805-
} else {
806-
if (epp == -EINVAL)
807-
epp = (pref_index - 1) << 2;
808-
ret = intel_pstate_set_epb(cpu_data->cpu, epp);
809769
}
810770

811771
return ret;
@@ -1337,9 +1297,8 @@ static void intel_pstate_hwp_set(unsigned int cpu)
13371297
if (boot_cpu_has(X86_FEATURE_HWP_EPP)) {
13381298
value &= ~GENMASK_ULL(31, 24);
13391299
value |= (u64)epp << 24;
1340-
} else {
1341-
intel_pstate_set_epb(cpu, epp);
13421300
}
1301+
13431302
skip_epp:
13441303
WRITE_ONCE(cpu_data->hwp_req_cached, value);
13451304
wrmsrq_on_cpu(cpu, MSR_HWP_REQUEST, value);

0 commit comments

Comments
 (0)