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

Commit 4190624

Browse files
committed
Merge tag 'pm-6.11-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm
Pull power management updates from Rafael Wysocki: "These add a new cpufreq driver for Loongson-3, add support for new features in the intel_pstate (Lunar Lake and Arrow Lake platforms, OOB mode for Emerald Rapids, highest performance change interrupt), amd-pstate (fast CPPC) and sun50i (Allwinner H700 speed bin) cpufreq drivers, simplify the cpufreq driver interface, simplify the teo cpuidle governor, adjust the pm-graph utility for a new version of Python, address issues and clean up code. Specifics: - 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) - Improve the teo cpuidle governor and clean up leftover comments from the menu cpuidle governor (Christian Loehle) - Clean up a comment typo in the teo cpuidle governor (Atul Kumar Pant) - Add missing MODULE_DESCRIPTION() macro to cpuidle haltpoll (Jeff Johnson) - Switch the intel_idle driver to new Intel CPU model defines (Tony Luck) - Switch the Intel RAPL driver new Intel CPU model defines (Tony Luck) - Simplify if condition in the idle_inject driver (Thorsten Blum) - Fix missing cleanup on error in _opp_attach_genpd() (Viresh Kumar) - Introduce an OF helper function to inform if required-opps is used and drop a redundant in-parameter to _set_opp_level() (Ulf Hansson) - Update pm-graph to v5.12 which includes fixes and major code revamp for python3.12 (Todd Brandt) - Address several assorted issues in the cpupower utility (Roman Storozhenko)" * tag 'pm-6.11-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (77 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 cpupower: fix lib default installation path cpufreq: docs: Add missing scaling_available_frequencies description cpuidle: teo: Don't count non-existent intercepts cpupower: Disable direct build of the 'bench' subproject cpuidle: teo: Remove recent intercepts metric Revert: "cpuidle: teo: Introduce util-awareness" 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 ...
2 parents 15114e8 + a02bed4 commit 4190624

Some content is hidden

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

68 files changed

+1958
-1269
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
@@ -13040,6 +13040,7 @@ F: Documentation/arch/loongarch/
1304013040
F: Documentation/translations/zh_CN/arch/loongarch/
1304113041
F: arch/loongarch/
1304213042
F: drivers/*/*loongarch*
13043+
F: drivers/cpufreq/loongson3_cpufreq.c
1304313044

1304413045
LOONGSON GPIO DRIVER
1304513046
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_act_window" HWP Activity Window */
362362
#define X86_FEATURE_HWP_EPP (14*32+10) /* "hwp_epp" HWP Energy Perf. Preference */
363363
#define X86_FEATURE_HWP_PKG_REQ (14*32+11) /* "hwp_pkg_req" 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) /* "hfi" Hardware Feedback Interface */
365366

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

475477
/*
476478
* BUG word(s)

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -783,6 +783,8 @@
783783
#define MSR_K7_HWCR_IRPERF_EN BIT_ULL(MSR_K7_HWCR_IRPERF_EN_BIT)
784784
#define MSR_K7_FID_VID_CTL 0xc0010041
785785
#define MSR_K7_FID_VID_STATUS 0xc0010042
786+
#define MSR_K7_HWCR_CPB_DIS_BIT 25
787+
#define MSR_K7_HWCR_CPB_DIS BIT_ULL(MSR_K7_HWCR_CPB_DIS_BIT)
786788

787789
/* K6 MSRs */
788790
#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)