Skip to content

Commit ad1871a

Browse files
committed
Merge tag 'pm-6.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm
Pull power management updates from Rafael Wysocki: "These add new hardware support (new Qualcomm SoC versions in cpufreq, RK3568/RK3588 in devfreq), extend the OPP (operating performance points) framework, improve cpufreq governors, fix issues and clean up code (most of the changes are in cpufreq and devfreq). Specifics: - Add support for several Qualcomm SoC versions and other similar changes (Christian Marangi, Dmitry Baryshkov, Luca Weiss, Neil Armstrong, Richard Acayan, Robert Marko, Rohit Agarwal, Stephan Gerhold and Varadarajan Narayanan) - Clean up the tegra cpufreq driver (Sumit Gupta) - Use of_property_read_reg() to parse "reg" in pmac32 driver (Rob Herring) - Add support for TI's am62p5 Soc (Bryan Brattlof) - Make ARM_BRCMSTB_AVS_CPUFREQ depends on !ARM_SCMI_CPUFREQ (Florian Fainelli) - Update Kconfig to mention i.MX7 as well (Alexander Stein) - Revise global turbo disable check in intel_pstate (Srinivas Pandruvada) - Carry out initialization of sg_cpu in the schedutil cpufreq governor in one loop (Liao Chang) - Simplify the condition for storing 'down_threshold' in the conservative cpufreq governor (Liao Chang) - Use fine-grained mutex in the userspace cpufreq governor (Liao Chang) - Move is_managed indicator in the userspace cpufreq governor into a per-policy structure (Liao Chang) - Rebuild sched-domains when removing cpufreq driver (Pierre Gondois) - Fix buffer overflow detection in trans_stats() (Christian Marangi) - Switch to dev_pm_opp_find_freq_(ceil/floor)_indexed() APIs to support specific devices like UFS which handle multiple clocks through OPP (Operating Performance Point) framework (Manivannan Sadhasivam) - Add perf support to the Rockchip DFI (DDR Monitor Module) devfreq- event driver: * Generalize rockchip-dfi.c to support new RK3568/RK3588 using different DDR type (Sascha Hauer). * Convert DT binding document format to yaml (Sascha Hauer). * Add perf support for DFI (a unit suitable for measuring DDR utilization) to rockchip-dfi.c to extend DFI usage (Sascha Hauer) - Add locking to the OPP handling code in the Mediatek CCI devfreq driver, because the voltage of shared OPP might be changed by multiple drivers (Mark Tseng, Dan Carpenter) - Use device_get_match_data() in the Samsung Exynos PPMU devfreq-event driver (Rob Herring) - Extend support for the opp-level beyond required-opps (Ulf Hansson) - Add dev_pm_opp_find_level_floor() (Krishna chaitanya chundru) - dt-bindings: Allow opp-peak-kBpsfor kryo CPUs, support Qualcomm Krait SoCs and document named opp-microvolt property (Bjorn Andersson, Dmitry Baryshkov and Christian Marangi) - Fix -Wunsequenced warning _of_add_opp_table_v1() (Nathan Chancellor) - General cleanup of OPP code (Viresh Kumar) - Use __get_safe_page() rather than touching the list in hibernation snapshot code (Brian Geffon) - Fix symbol export for _SIMPLE_ variants of _PM_OPS() (Raag Jadav) - Clean up sync_read handling in snapshot_write_next() (Brian Geffon) - Fix kerneldoc comments for swsusp_check() and swsusp_close() to better match code (Christoph Hellwig) - Downgrade BIOS locked limits pr_warn() in the Intel RAPL power capping driver to pr_debug() (Ville Syrjälä) - Change the minimum python version for the intel_pstate_tracer utility from 2.7 to 3.6 (Doug Smythies)" * tag 'pm-6.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (82 commits) dt-bindings: cpufreq: qcom-hw: document SM8650 CPUFREQ Hardware cpufreq: arm: Kconfig: Add i.MX7 to supported SoC for ARM_IMX_CPUFREQ_DT cpufreq: qcom-nvmem: add support for IPQ8064 cpufreq: qcom-nvmem: also accept operating-points-v2-krait-cpu cpufreq: qcom-nvmem: drop pvs_ver for format a fuses dt-bindings: cpufreq: qcom-cpufreq-nvmem: Document krait-cpu cpufreq: qcom-nvmem: add support for IPQ6018 dt-bindings: cpufreq: qcom-cpufreq-nvmem: document IPQ6018 cpufreq: qcom-nvmem: Add MSM8909 cpufreq: qcom-nvmem: Simplify driver data allocation powercap: intel_rapl: Downgrade BIOS locked limits pr_warn() to pr_debug() cpufreq: stats: Fix buffer overflow detection in trans_stats() dt-bindings: devfreq: event: rockchip,dfi: Add rk3588 support dt-bindings: devfreq: event: rockchip,dfi: Add rk3568 support dt-bindings: devfreq: event: convert Rockchip DFI binding to yaml PM / devfreq: rockchip-dfi: add support for RK3588 PM / devfreq: rockchip-dfi: account for multiple DDRMON_CTRL registers PM / devfreq: rockchip-dfi: make register stride SoC specific PM / devfreq: rockchip-dfi: Add perf support PM / devfreq: rockchip-dfi: give variable a better name ...
2 parents d4b671d + bf22487 commit ad1871a

Some content is hidden

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

41 files changed

+1540
-565
lines changed

Documentation/devicetree/bindings/cpufreq/cpufreq-qcom-hw.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ properties:
2323
- enum:
2424
- qcom,qcm2290-cpufreq-hw
2525
- qcom,sc7180-cpufreq-hw
26+
- qcom,sdm670-cpufreq-hw
2627
- qcom,sdm845-cpufreq-hw
2728
- qcom,sm6115-cpufreq-hw
2829
- qcom,sm6350-cpufreq-hw
@@ -36,11 +37,13 @@ properties:
3637
- qcom,sa8775p-cpufreq-epss
3738
- qcom,sc7280-cpufreq-epss
3839
- qcom,sc8280xp-cpufreq-epss
40+
- qcom,sdx75-cpufreq-epss
3941
- qcom,sm6375-cpufreq-epss
4042
- qcom,sm8250-cpufreq-epss
4143
- qcom,sm8350-cpufreq-epss
4244
- qcom,sm8450-cpufreq-epss
4345
- qcom,sm8550-cpufreq-epss
46+
- qcom,sm8650-cpufreq-epss
4447
- const: qcom,cpufreq-epss
4548

4649
reg:
@@ -128,6 +131,7 @@ allOf:
128131
- qcom,qdu1000-cpufreq-epss
129132
- qcom,sc7180-cpufreq-hw
130133
- qcom,sc8280xp-cpufreq-epss
134+
- qcom,sdm670-cpufreq-hw
131135
- qcom,sdm845-cpufreq-hw
132136
- qcom,sm6115-cpufreq-hw
133137
- qcom,sm6350-cpufreq-hw

Documentation/devicetree/bindings/cpufreq/qcom-cpufreq-nvmem.yaml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,12 @@ select:
2727
enum:
2828
- qcom,apq8064
2929
- qcom,apq8096
30+
- qcom,ipq5332
31+
- qcom,ipq6018
3032
- qcom,ipq8064
3133
- qcom,ipq8074
34+
- qcom,ipq9574
35+
- qcom,msm8909
3236
- qcom,msm8939
3337
- qcom,msm8960
3438
- qcom,msm8974
@@ -43,7 +47,9 @@ patternProperties:
4347
- if:
4448
properties:
4549
compatible:
46-
const: operating-points-v2-kryo-cpu
50+
enum:
51+
- operating-points-v2-krait-cpu
52+
- operating-points-v2-kryo-cpu
4753
then:
4854
$ref: /schemas/opp/opp-v2-kryo-cpu.yaml#
4955

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/devfreq/event/rockchip,dfi.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: Rockchip DFI
8+
9+
maintainers:
10+
- Sascha Hauer <[email protected]>
11+
12+
properties:
13+
compatible:
14+
enum:
15+
- rockchip,rk3399-dfi
16+
- rockchip,rk3568-dfi
17+
- rockchip,rk3588-dfi
18+
19+
clocks:
20+
maxItems: 1
21+
22+
clock-names:
23+
items:
24+
- const: pclk_ddr_mon
25+
26+
interrupts:
27+
minItems: 1
28+
maxItems: 4
29+
30+
reg:
31+
maxItems: 1
32+
33+
rockchip,pmu:
34+
$ref: /schemas/types.yaml#/definitions/phandle
35+
description:
36+
Phandle to the syscon managing the "PMU general register files".
37+
38+
required:
39+
- compatible
40+
- interrupts
41+
- reg
42+
43+
if:
44+
properties:
45+
compatible:
46+
contains:
47+
enum:
48+
- rockchip,rk3399-dfi
49+
50+
then:
51+
required:
52+
- clocks
53+
- clock-names
54+
55+
additionalProperties: false
56+
57+
examples:
58+
- |
59+
#include <dt-bindings/interrupt-controller/arm-gic.h>
60+
#include <dt-bindings/clock/rk3308-cru.h>
61+
62+
bus {
63+
#address-cells = <2>;
64+
#size-cells = <2>;
65+
66+
dfi: dfi@ff630000 {
67+
compatible = "rockchip,rk3399-dfi";
68+
reg = <0x00 0xff630000 0x00 0x4000>;
69+
interrupts = <GIC_SPI 131 IRQ_TYPE_LEVEL_HIGH 0>;
70+
rockchip,pmu = <&pmugrf>;
71+
clocks = <&cru PCLK_DDR_MON>;
72+
clock-names = "pclk_ddr_mon";
73+
};
74+
};

Documentation/devicetree/bindings/devfreq/event/rockchip-dfi.txt

Lines changed: 0 additions & 18 deletions
This file was deleted.

Documentation/devicetree/bindings/memory-controllers/rockchip,rk3399-dmc.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ properties:
1818
$ref: /schemas/types.yaml#/definitions/phandle
1919
description:
2020
Node to get DDR loading. Refer to
21-
Documentation/devicetree/bindings/devfreq/event/rockchip-dfi.txt.
21+
Documentation/devicetree/bindings/devfreq/event/rockchip,dfi.yaml.
2222

2323
clocks:
2424
maxItems: 1

Documentation/devicetree/bindings/opp/opp-v2-kryo-cpu.yaml

Lines changed: 32 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,9 @@ description: |
2626
2727
properties:
2828
compatible:
29-
const: operating-points-v2-kryo-cpu
29+
enum:
30+
- operating-points-v2-krait-cpu
31+
- operating-points-v2-kryo-cpu
3032

3133
nvmem-cells:
3234
description: |
@@ -47,6 +49,8 @@ patternProperties:
4749

4850
opp-microvolt: true
4951

52+
opp-peak-kBps: true
53+
5054
opp-supported-hw:
5155
description: |
5256
A single 32 bit bitmap value, representing compatible HW.
@@ -63,14 +67,22 @@ patternProperties:
6367
5: MSM8996SG, speedbin 1
6468
6: MSM8996SG, speedbin 2
6569
7-31: unused
66-
enum: [0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7,
67-
0x9, 0xd, 0xe, 0xf,
68-
0x10, 0x20, 0x30, 0x70]
70+
71+
Bitmap for IPQ806x SoC:
72+
0: IPQ8062
73+
1: IPQ8064/IPQ8066/IPQ8068
74+
2: IPQ8065/IPQ8069
75+
3-31: unused
76+
77+
Other platforms use bits directly corresponding to speedbin index.
6978
7079
clock-latency-ns: true
7180

7281
required-opps: true
7382

83+
patternProperties:
84+
'^opp-microvolt-speed[0-9]+-pvs[0-9]+$': true
85+
7486
required:
7587
- opp-hz
7688

@@ -256,6 +268,22 @@ examples:
256268
};
257269
};
258270
271+
/* Dummy opp table to give example for named opp-microvolt */
272+
opp-table-2 {
273+
compatible = "operating-points-v2-krait-cpu";
274+
nvmem-cells = <&speedbin_efuse>;
275+
276+
opp-384000000 {
277+
opp-hz = /bits/ 64 <384000000>;
278+
opp-microvolt-speed0-pvs0 = <1000000 950000 1050000>;
279+
opp-microvolt-speed0-pvs1 = <925000 878750 971250>;
280+
opp-microvolt-speed0-pvs2 = <875000 831250 918750>;
281+
opp-microvolt-speed0-pvs3 = <800000 760000 840000>;
282+
opp-supported-hw = <0x7>;
283+
clock-latency-ns = <100000>;
284+
};
285+
};
286+
259287
smem {
260288
compatible = "qcom,smem";
261289
memory-region = <&smem_mem>;

drivers/base/power/common.c

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,3 +228,24 @@ void dev_pm_domain_set(struct device *dev, struct dev_pm_domain *pd)
228228
device_pm_check_callbacks(dev);
229229
}
230230
EXPORT_SYMBOL_GPL(dev_pm_domain_set);
231+
232+
/**
233+
* dev_pm_domain_set_performance_state - Request a new performance state.
234+
* @dev: The device to make the request for.
235+
* @state: Target performance state for the device.
236+
*
237+
* This function should be called when a new performance state needs to be
238+
* requested for a device that is attached to a PM domain. Note that, the
239+
* support for performance scaling for PM domains is optional.
240+
*
241+
* Returns 0 on success and when performance scaling isn't supported, negative
242+
* error code on failure.
243+
*/
244+
int dev_pm_domain_set_performance_state(struct device *dev, unsigned int state)
245+
{
246+
if (dev->pm_domain && dev->pm_domain->set_performance_state)
247+
return dev->pm_domain->set_performance_state(dev, state);
248+
249+
return 0;
250+
}
251+
EXPORT_SYMBOL_GPL(dev_pm_domain_set_performance_state);

drivers/base/power/domain.c

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -419,6 +419,25 @@ static void genpd_restore_performance_state(struct device *dev,
419419
genpd_set_performance_state(dev, state);
420420
}
421421

422+
static int genpd_dev_pm_set_performance_state(struct device *dev,
423+
unsigned int state)
424+
{
425+
struct generic_pm_domain *genpd = dev_to_genpd(dev);
426+
int ret = 0;
427+
428+
genpd_lock(genpd);
429+
if (pm_runtime_suspended(dev)) {
430+
dev_gpd_data(dev)->rpm_pstate = state;
431+
} else {
432+
ret = genpd_set_performance_state(dev, state);
433+
if (!ret)
434+
dev_gpd_data(dev)->rpm_pstate = 0;
435+
}
436+
genpd_unlock(genpd);
437+
438+
return ret;
439+
}
440+
422441
/**
423442
* dev_pm_genpd_set_performance_state- Set performance state of device's power
424443
* domain.
@@ -437,7 +456,6 @@ static void genpd_restore_performance_state(struct device *dev,
437456
int dev_pm_genpd_set_performance_state(struct device *dev, unsigned int state)
438457
{
439458
struct generic_pm_domain *genpd;
440-
int ret = 0;
441459

442460
genpd = dev_to_genpd_safe(dev);
443461
if (!genpd)
@@ -447,17 +465,7 @@ int dev_pm_genpd_set_performance_state(struct device *dev, unsigned int state)
447465
!dev->power.subsys_data->domain_data))
448466
return -EINVAL;
449467

450-
genpd_lock(genpd);
451-
if (pm_runtime_suspended(dev)) {
452-
dev_gpd_data(dev)->rpm_pstate = state;
453-
} else {
454-
ret = genpd_set_performance_state(dev, state);
455-
if (!ret)
456-
dev_gpd_data(dev)->rpm_pstate = 0;
457-
}
458-
genpd_unlock(genpd);
459-
460-
return ret;
468+
return genpd_dev_pm_set_performance_state(dev, state);
461469
}
462470
EXPORT_SYMBOL_GPL(dev_pm_genpd_set_performance_state);
463471

@@ -2079,6 +2087,7 @@ int pm_genpd_init(struct generic_pm_domain *genpd,
20792087
genpd->domain.ops.restore_noirq = genpd_restore_noirq;
20802088
genpd->domain.ops.complete = genpd_complete;
20812089
genpd->domain.start = genpd_dev_pm_start;
2090+
genpd->domain.set_performance_state = genpd_dev_pm_set_performance_state;
20822091

20832092
if (genpd->flags & GENPD_FLAG_PM_CLK) {
20842093
genpd->dev_ops.stop = pm_clk_suspend;

drivers/cpufreq/Kconfig.arm

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ config ARM_VEXPRESS_SPC_CPUFREQ
9090

9191
config ARM_BRCMSTB_AVS_CPUFREQ
9292
tristate "Broadcom STB AVS CPUfreq driver"
93-
depends on ARCH_BRCMSTB || COMPILE_TEST
93+
depends on (ARCH_BRCMSTB && !ARM_SCMI_CPUFREQ) || COMPILE_TEST
9494
default y
9595
help
9696
Some Broadcom STB SoCs use a co-processor running proprietary firmware
@@ -124,8 +124,8 @@ config ARM_IMX_CPUFREQ_DT
124124
tristate "Freescale i.MX8M cpufreq support"
125125
depends on ARCH_MXC && CPUFREQ_DT
126126
help
127-
This adds cpufreq driver support for Freescale i.MX8M series SoCs,
128-
based on cpufreq-dt.
127+
This adds cpufreq driver support for Freescale i.MX7/i.MX8M
128+
series SoCs, based on cpufreq-dt.
129129

130130
If in doubt, say N.
131131

drivers/cpufreq/cpufreq-dt-platdev.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,9 +142,11 @@ static const struct of_device_id blocklist[] __initconst = {
142142
{ .compatible = "nvidia,tegra234", },
143143

144144
{ .compatible = "qcom,apq8096", },
145+
{ .compatible = "qcom,msm8909", },
145146
{ .compatible = "qcom,msm8996", },
146147
{ .compatible = "qcom,msm8998", },
147148
{ .compatible = "qcom,qcm2290", },
149+
{ .compatible = "qcom,qcm6490", },
148150
{ .compatible = "qcom,qcs404", },
149151
{ .compatible = "qcom,qdu1000", },
150152
{ .compatible = "qcom,sa8155p" },
@@ -176,7 +178,9 @@ static const struct of_device_id blocklist[] __initconst = {
176178
{ .compatible = "ti,omap3", },
177179
{ .compatible = "ti,am625", },
178180
{ .compatible = "ti,am62a7", },
181+
{ .compatible = "ti,am62p5", },
179182

183+
{ .compatible = "qcom,ipq6018", },
180184
{ .compatible = "qcom,ipq8064", },
181185
{ .compatible = "qcom,apq8064", },
182186
{ .compatible = "qcom,msm8974", },

drivers/cpufreq/cpufreq.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1544,7 +1544,7 @@ static int cpufreq_online(unsigned int cpu)
15441544

15451545
/*
15461546
* Register with the energy model before
1547-
* sched_cpufreq_governor_change() is called, which will result
1547+
* sugov_eas_rebuild_sd() is called, which will result
15481548
* in rebuilding of the sched domains, which should only be done
15491549
* once the energy model is properly initialized for the policy
15501550
* first.
@@ -2652,7 +2652,6 @@ static int cpufreq_set_policy(struct cpufreq_policy *policy,
26522652
ret = cpufreq_start_governor(policy);
26532653
if (!ret) {
26542654
pr_debug("governor change\n");
2655-
sched_cpufreq_governor_change(policy, old_gov);
26562655
return 0;
26572656
}
26582657
cpufreq_exit_governor(policy);

drivers/cpufreq/cpufreq_conservative.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,8 +187,7 @@ static ssize_t down_threshold_store(struct gov_attr_set *attr_set,
187187
ret = sscanf(buf, "%u", &input);
188188

189189
/* cannot be lower than 1 otherwise freq will not fall */
190-
if (ret != 1 || input < 1 || input > 100 ||
191-
input >= dbs_data->up_threshold)
190+
if (ret != 1 || input < 1 || input >= dbs_data->up_threshold)
192191
return -EINVAL;
193192

194193
cs_tuners->down_threshold = input;

0 commit comments

Comments
 (0)