Skip to content

Commit 10ec0ed

Browse files
author
Frantisek Hrbata
committed
Merge: Update drivers/powercap to enable support for Arm SystemReady IR platforms
MR: https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-9/-/merge_requests/1372 ``` Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2126952 This is one of a series of patch sets to enable Arm SystemReady IR support in the kernel for compliant platforms. This set cleans up powercap and enables DTPM for edge systems to use in thermal and power management; this is all in drivers/powercap. This set has been tested via simple boot tests, and of course the CI loop. This may be difficult to test on Arm due to DTPM being a very new feature. However, this is exactly the same powercap framework used by intel_rapl, which should continue to function properly regardless. Signed-off-by: Al Stone <ahs3@redhat.com> ``` Approved-by: David Arcari <darcari@redhat.com> Approved-by: Mark Langsdorf <mlangsdo@redhat.com> Approved-by: Phil Auld <pauld@redhat.com> Signed-off-by: Frantisek Hrbata <fhrbata@redhat.com>
2 parents b2a0148 + d92c58e commit 10ec0ed

File tree

26 files changed

+741
-274
lines changed

26 files changed

+741
-274
lines changed

Documentation/power/energy-model.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,8 +136,8 @@ EM framework::
136136

137137
-> drivers/cpufreq/foo_cpufreq.c
138138

139-
01 static int est_power(unsigned long *mW, unsigned long *KHz,
140-
02 struct device *dev)
139+
01 static int est_power(struct device *dev, unsigned long *mW,
140+
02 unsigned long *KHz)
141141
03 {
142142
04 long freq, power;
143143
05

drivers/cpufreq/scmi-cpufreq.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,8 @@ scmi_get_sharing_cpus(struct device *cpu_dev, struct cpumask *cpumask)
9494
}
9595

9696
static int __maybe_unused
97-
scmi_get_cpu_power(unsigned long *power, unsigned long *KHz,
98-
struct device *cpu_dev)
97+
scmi_get_cpu_power(struct device *cpu_dev, unsigned long *power,
98+
unsigned long *KHz)
9999
{
100100
unsigned long Hz;
101101
int ret, domain;

drivers/opp/of.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1448,7 +1448,7 @@ EXPORT_SYMBOL_GPL(dev_pm_opp_get_of_node);
14481448
* Returns 0 on success or a proper -EINVAL value in case of error.
14491449
*/
14501450
static int __maybe_unused
1451-
_get_dt_power(unsigned long *mW, unsigned long *kHz, struct device *dev)
1451+
_get_dt_power(struct device *dev, unsigned long *mW, unsigned long *kHz)
14521452
{
14531453
struct dev_pm_opp *opp;
14541454
unsigned long opp_freq, opp_power;
@@ -1482,8 +1482,8 @@ _get_dt_power(unsigned long *mW, unsigned long *kHz, struct device *dev)
14821482
* Returns -EINVAL if the power calculation failed because of missing
14831483
* parameters, 0 otherwise.
14841484
*/
1485-
static int __maybe_unused _get_power(unsigned long *mW, unsigned long *kHz,
1486-
struct device *dev)
1485+
static int __maybe_unused _get_power(struct device *dev, unsigned long *mW,
1486+
unsigned long *kHz)
14871487
{
14881488
struct dev_pm_opp *opp;
14891489
struct device_node *np;

drivers/powercap/Kconfig

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ config IDLE_INJECT
4646

4747
config DTPM
4848
bool "Power capping for Dynamic Thermal Power Management (EXPERIMENTAL)"
49+
depends on OF
4950
help
5051
This enables support for the power capping for the dynamic
5152
thermal power management userspace engine.
@@ -56,4 +57,11 @@ config DTPM_CPU
5657
help
5758
This enables support for CPU power limitation based on
5859
energy model.
60+
61+
config DTPM_DEVFREQ
62+
bool "Add device power capping based on the energy model"
63+
depends on DTPM && ENERGY_MODEL
64+
help
65+
This enables support for device power limitation based on
66+
energy model.
5967
endif

drivers/powercap/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# SPDX-License-Identifier: GPL-2.0-only
22
obj-$(CONFIG_DTPM) += dtpm.o
33
obj-$(CONFIG_DTPM_CPU) += dtpm_cpu.o
4+
obj-$(CONFIG_DTPM_DEVFREQ) += dtpm_devfreq.o
45
obj-$(CONFIG_POWERCAP) += powercap_sys.o
56
obj-$(CONFIG_INTEL_RAPL_CORE) += intel_rapl_common.o
67
obj-$(CONFIG_INTEL_RAPL) += intel_rapl_msr.o

0 commit comments

Comments
 (0)