Skip to content
This repository was archived by the owner on Nov 8, 2023. It is now read-only.

Commit a18abb8

Browse files
committed
Merge branch 'pm-cpufreq'
Merge cpufreq changes for 6.11-rc1: - Add Loongson-3 CPUFreq driver support (Huacai Chen). - Add support for the Arrow Lake and Lunar Lake platforms and the out-of-band (OOB) mode on Emerald Rapids to the intel_pstate cpufreq driver, make it support the highest performance change interrupt and clean it up (Srinivas Pandruvada). - Switch cpufreq to new Intel CPU model defines (Tony Luck). - Simplify the cpufreq driver interface by switching the .exit() driver callback to the void return data type (Lizhe, Viresh Kumar). - Make cpufreq_boost_enabled() return bool (Dhruva Gole). - Add fast CPPC support to the amd-pstate cpufreq driver, address multiple assorted issues in it and clean it up (Perry Yuan, Mario Limonciello, Dhananjay Ugwekar, Meng Li, Xiaojian Du). - Add Allwinner H700 speed bin to the sun50i cpufreq driver (Ryan Walklin). - Fix memory leaks and of_node_put() usage in the sun50i and qcom-nvmem cpufreq drivers (Javier Carrasco). - Clean up the sti and dt-platdev cpufreq drivers (Jeff Johnson, Raphael Gallais-Pou). - Fix deferred probe handling in the TI cpufreq driver and wrong return values of ti_opp_supply_probe(), and add OPP tables for the AM62Ax and AM62Px SoCs to it (Bryan Brattlof, Primoz Fiser). - Avoid overflow of target_freq in .fast_switch() in the SCMI cpufreq driver (Jagadeesh Kona). - Use dev_err_probe() in every error path in probe in the Mediatek cpufreq driver (Nícolas Prado). - Fix kernel-doc param for longhaul_setstate in the longhaul cpufreq driver (Yang Li). - Fix system resume handling in the CPPC cpufreq driver (Riwen Lu). * pm-cpufreq: (55 commits) cpufreq: sti: fix build warning cpufreq: mediatek: Use dev_err_probe in every error path in probe cpufreq: Add Loongson-3 CPUFreq driver support cpufreq: Make cpufreq_driver->exit() return void cpufreq/amd-pstate: Fix the scaling_max_freq setting on shared memory CPPC systems cpufreq/amd-pstate-ut: Convert nominal_freq to khz during comparisons cpufreq: pcc: Remove empty exit() callback cpufreq: loongson2: Remove empty exit() callback cpufreq: nforce2: Remove empty exit() callback cpufreq: docs: Add missing scaling_available_frequencies description cpufreq: make cpufreq_boost_enabled() return bool cpufreq: intel_pstate: Support highest performance change interrupt x86/cpufeatures: Add HWP highest perf change feature flag Documentation: cpufreq: amd-pstate: update doc for Per CPU boost control method cpufreq: amd-pstate: Cap the CPPC.max_perf to nominal_perf if CPB is off cpufreq: amd-pstate: initialize core precision boost state cpufreq: acpi: move MSR_K7_HWCR_CPB_DIS_BIT into msr-index.h cpufreq: sti: add missing MODULE_DEVICE_TABLE entry for stih418 cpufreq: intel_pstate: Replace boot_cpu_has() cpufreq: ti: update OPP table for AM62Px SoCs ...
2 parents 130abfe + 9dabb5b commit a18abb8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+985
-382
lines changed

Documentation/admin-guide/pm/amd-pstate.rst

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,22 @@ integer values defined between 0 to 255 when EPP feature is enabled by platform
281281
firmware, if EPP feature is disabled, driver will ignore the written value
282282
This attribute is read-write.
283283

284+
``boost``
285+
The `boost` sysfs attribute provides control over the CPU core
286+
performance boost, allowing users to manage the maximum frequency limitation
287+
of the CPU. This attribute can be used to enable or disable the boost feature
288+
on individual CPUs.
289+
290+
When the boost feature is enabled, the CPU can dynamically increase its frequency
291+
beyond the base frequency, providing enhanced performance for demanding workloads.
292+
On the other hand, disabling the boost feature restricts the CPU to operate at the
293+
base frequency, which may be desirable in certain scenarios to prioritize power
294+
efficiency or manage temperature.
295+
296+
To manipulate the `boost` attribute, users can write a value of `0` to disable the
297+
boost or `1` to enable it, for the respective CPU using the sysfs path
298+
`/sys/devices/system/cpu/cpuX/cpufreq/boost`, where `X` represents the CPU number.
299+
284300
Other performance and frequency values can be read back from
285301
``/sys/devices/system/cpu/cpuX/acpi_cppc/``, see :ref:`cppc_sysfs`.
286302

@@ -406,7 +422,7 @@ control its functionality at the system level. They are located in the
406422
``/sys/devices/system/cpu/amd_pstate/`` directory and affect all CPUs.
407423

408424
``status``
409-
Operation mode of the driver: "active", "passive" or "disable".
425+
Operation mode of the driver: "active", "passive", "guided" or "disable".
410426

411427
"active"
412428
The driver is functional and in the ``active mode``

Documentation/admin-guide/pm/cpufreq.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,10 @@ are the following:
267267
``related_cpus``
268268
List of all (online and offline) CPUs belonging to this policy.
269269

270+
``scaling_available_frequencies``
271+
List of available frequencies of the CPUs belonging to this policy
272+
(in kHz).
273+
270274
``scaling_available_governors``
271275
List of ``CPUFreq`` scaling governors present in the kernel that can
272276
be attached to this policy or (if the |intel_pstate| scaling driver is

MAINTAINERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12966,6 +12966,7 @@ F: Documentation/arch/loongarch/
1296612966
F: Documentation/translations/zh_CN/arch/loongarch/
1296712967
F: arch/loongarch/
1296812968
F: drivers/*/*loongarch*
12969+
F: drivers/cpufreq/loongson3_cpufreq.c
1296912970

1297012971
LOONGSON GPIO DRIVER
1297112972
M: Yinbo Zhu <zhuyinbo@loongson.cn>

arch/x86/include/asm/cpufeatures.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -361,6 +361,7 @@
361361
#define X86_FEATURE_HWP_ACT_WINDOW (14*32+ 9) /* HWP Activity Window */
362362
#define X86_FEATURE_HWP_EPP (14*32+10) /* HWP Energy Perf. Preference */
363363
#define X86_FEATURE_HWP_PKG_REQ (14*32+11) /* HWP Package Level Request */
364+
#define X86_FEATURE_HWP_HIGHEST_PERF_CHANGE (14*32+15) /* "" HWP Highest perf change */
364365
#define X86_FEATURE_HFI (14*32+19) /* Hardware Feedback Interface */
365366

366367
/* AMD SVM Feature Identification, CPUID level 0x8000000a (EDX), word 15 */
@@ -470,6 +471,7 @@
470471
#define X86_FEATURE_BHI_CTRL (21*32+ 2) /* "" BHI_DIS_S HW control available */
471472
#define X86_FEATURE_CLEAR_BHB_HW (21*32+ 3) /* "" BHI_DIS_S HW control enabled */
472473
#define X86_FEATURE_CLEAR_BHB_LOOP_ON_VMEXIT (21*32+ 4) /* "" Clear branch history at vmexit using SW loop */
474+
#define X86_FEATURE_FAST_CPPC (21*32 + 5) /* "" AMD Fast CPPC */
473475

474476
/*
475477
* BUG word(s)

arch/x86/include/asm/msr-index.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -781,6 +781,8 @@
781781
#define MSR_K7_HWCR_IRPERF_EN BIT_ULL(MSR_K7_HWCR_IRPERF_EN_BIT)
782782
#define MSR_K7_FID_VID_CTL 0xc0010041
783783
#define MSR_K7_FID_VID_STATUS 0xc0010042
784+
#define MSR_K7_HWCR_CPB_DIS_BIT 25
785+
#define MSR_K7_HWCR_CPB_DIS BIT_ULL(MSR_K7_HWCR_CPB_DIS_BIT)
784786

785787
/* K6 MSRs */
786788
#define MSR_K6_WHCR 0xc0000082

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/Kconfig

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,18 @@ config LOONGSON2_CPUFREQ
262262
If in doubt, say N.
263263
endif
264264

265+
if LOONGARCH
266+
config LOONGSON3_CPUFREQ
267+
tristate "Loongson3 CPUFreq Driver"
268+
help
269+
This option adds a CPUFreq driver for Loongson processors which
270+
support software configurable cpu frequency.
271+
272+
Loongson-3 family processors support this feature.
273+
274+
If in doubt, say N.
275+
endif
276+
265277
if SPARC64
266278
config SPARC_US3_CPUFREQ
267279
tristate "UltraSPARC-III CPU Frequency driver"

drivers/cpufreq/Kconfig.x86

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ config X86_AMD_PSTATE_DEFAULT_MODE
7171
config X86_AMD_PSTATE_UT
7272
tristate "selftest for AMD Processor P-State driver"
7373
depends on X86 && ACPI_PROCESSOR
74+
depends on X86_AMD_PSTATE
7475
default n
7576
help
7677
This kernel module is used for testing. It's safe to say M here.

drivers/cpufreq/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ obj-$(CONFIG_POWERNV_CPUFREQ) += powernv-cpufreq.o
103103
# Other platform drivers
104104
obj-$(CONFIG_BMIPS_CPUFREQ) += bmips-cpufreq.o
105105
obj-$(CONFIG_LOONGSON2_CPUFREQ) += loongson2_cpufreq.o
106+
obj-$(CONFIG_LOONGSON3_CPUFREQ) += loongson3_cpufreq.o
106107
obj-$(CONFIG_SH_CPU_FREQ) += sh-cpufreq.o
107108
obj-$(CONFIG_SPARC_US2E_CPUFREQ) += sparc-us2e-cpufreq.o
108109
obj-$(CONFIG_SPARC_US3_CPUFREQ) += sparc-us3-cpufreq.o

drivers/cpufreq/acpi-cpufreq.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,6 @@ enum {
5050
#define AMD_MSR_RANGE (0x7)
5151
#define HYGON_MSR_RANGE (0x7)
5252

53-
#define MSR_K7_HWCR_CPB_DIS (1ULL << 25)
54-
5553
struct acpi_cpufreq_data {
5654
unsigned int resume;
5755
unsigned int cpu_feature;
@@ -908,7 +906,7 @@ static int acpi_cpufreq_cpu_init(struct cpufreq_policy *policy)
908906
return result;
909907
}
910908

911-
static int acpi_cpufreq_cpu_exit(struct cpufreq_policy *policy)
909+
static void acpi_cpufreq_cpu_exit(struct cpufreq_policy *policy)
912910
{
913911
struct acpi_cpufreq_data *data = policy->driver_data;
914912

@@ -921,8 +919,6 @@ static int acpi_cpufreq_cpu_exit(struct cpufreq_policy *policy)
921919
free_cpumask_var(data->freqdomain_cpus);
922920
kfree(policy->freq_table);
923921
kfree(data);
924-
925-
return 0;
926922
}
927923

928924
static int acpi_cpufreq_resume(struct cpufreq_policy *policy)

0 commit comments

Comments
 (0)