Skip to content

Commit 173c6c5

Browse files
committed
Merge branch 'pm-cpufreq'
Merge cpufreq changes for 6.2-rc1: - Generalize of_perf_domain_get_sharing_cpumask phandle format (Hector Martin). - Add new cpufreq driver for Apple SoC CPU P-states (Hector Martin). - Update Qualcomm cpufreq driver, including: * CPU clock provider support, * Generic cleanups or reorganization. * Potential memleak fix. * Fix of the return value of cpufreq_driver->get(). (Manivannan Sadhasivam, Chen Hui). - Update Qualcomm cpufreq driver's DT bindings, including: * Support for CPU clock provider. * Missing cache-related properties fixes. * Support for QDU1000/QRU1000. (Manivannan Sadhasivam, Rob Herring, Melody Olvera). - Add support for ti,am625 SoC and enable build of ti-cpufreq for ARCH_K3 (Dave Gerlach, and Vibhore Vardhan). - Use flexible array to simplify memory allocation in the tegra186 cpufreq driver (Christophe JAILLET). - Convert cpufreq statistics code to use sysfs_emit_at() (ye xingchen). - Allow intel_pstate to use no-HWP mode on Sapphire Rapids (Giovanni Gherdovich). - Add missing pci_dev_put() to the amd_freq_sensitivity cpufreq driver (Xiongfeng Wang). - Initialize the kobj_unregister completion before calling kobject_init_and_add() in the cpufreq core code (Yongqiang Liu). - Defer setting boost MSRs in the ACPI cpufreq driver (Stuart Hayes, Nathan Chancellor). - Make intel_pstate accept initial EPP value of 0x80 (Srinivas Pandruvada). - Make read-only array sys_clk_src in the SPEAr cpufreq driver static (Colin Ian King). - Make array speeds in the longhaul cpufreq driver static (Colin Ian King). - Use str_enabled_disabled() helper in the ACPI cpufreq driver (Andy Shevchenko). - Drop a reference to CVS from cpufreq documentation (Conghui Wang). * pm-cpufreq: (30 commits) cpufreq: Remove CVS version control contents from documentation cpufreq: stats: Convert to use sysfs_emit_at() API cpufreq: ACPI: Only set boost MSRs on supported CPUs dt-bindings: cpufreq: cpufreq-qcom-hw: Add QDU1000/QRU1000 cpufreq cpufreq: tegra186: Use flexible array to simplify memory allocation cpufreq: intel_pstate: Add Sapphire Rapids support in no-HWP mode cpufreq: amd_freq_sensitivity: Add missing pci_dev_put() cpufreq: Init completion before kobject_init_and_add() cpufreq: apple-soc: Add new driver to control Apple SoC CPU P-states cpufreq: qcom-hw: Add CPU clock provider support dt-bindings: cpufreq: cpufreq-qcom-hw: Add cpufreq clock provider cpufreq: qcom-hw: Fix the frequency returned by cpufreq_driver->get() cpufreq: ACPI: Remove unused variables 'acpi_cpufreq_online' and 'ret' cpufreq: qcom-hw: Fix memory leak in qcom_cpufreq_hw_read_lut() arm64: dts: ti: k3-am625-sk: Add 1.4GHz OPP cpufreq: ti: Enable ti-cpufreq for ARCH_K3 arm64: dts: ti: k3-am625: Introduce operating-points table cpufreq: dt-platdev: Blacklist ti,am625 SoC cpufreq: ti-cpufreq: Add support for AM625 dt-bindings: cpufreq: qcom: Add missing cache related properties ...
2 parents dbfa447 + 04ac14a commit 173c6c5

20 files changed

Lines changed: 679 additions & 164 deletions

Documentation/cpu-freq/index.rst

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,18 +20,15 @@ Author: Dominik Brodowski <linux@brodo.de>
2020

2121
Mailing List
2222
------------
23-
There is a CPU frequency changing CVS commit and general list where
24-
you can report bugs, problems or submit patches. To post a message,
25-
send an email to linux-pm@vger.kernel.org.
23+
There is a CPU frequency general list where you can report bugs,
24+
problems or submit patches. To post a message, send an email to
25+
linux-pm@vger.kernel.org.
2626

2727
Links
2828
-----
2929
the FTP archives:
3030
* ftp://ftp.linux.org.uk/pub/linux/cpufreq/
3131

32-
how to access the CVS repository:
33-
* http://cvs.arm.linux.org.uk/
34-
3532
the CPUFreq Mailing list:
3633
* http://vger.kernel.org/vger-lists.html#linux-pm
3734

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

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ properties:
2525
- description: v2 of CPUFREQ HW (EPSS)
2626
items:
2727
- enum:
28+
- qcom,qdu1000-cpufreq-epss
2829
- qcom,sm6375-cpufreq-epss
2930
- qcom,sm8250-cpufreq-epss
3031
- const: qcom,cpufreq-epss
@@ -56,6 +57,9 @@ properties:
5657
'#freq-domain-cells':
5758
const: 1
5859

60+
'#clock-cells':
61+
const: 1
62+
5963
required:
6064
- compatible
6165
- reg
@@ -83,11 +87,16 @@ examples:
8387
enable-method = "psci";
8488
next-level-cache = <&L2_0>;
8589
qcom,freq-domain = <&cpufreq_hw 0>;
90+
clocks = <&cpufreq_hw 0>;
8691
L2_0: l2-cache {
8792
compatible = "cache";
93+
cache-unified;
94+
cache-level = <2>;
8895
next-level-cache = <&L3_0>;
8996
L3_0: l3-cache {
9097
compatible = "cache";
98+
cache-unified;
99+
cache-level = <3>;
91100
};
92101
};
93102
};
@@ -99,8 +108,11 @@ examples:
99108
enable-method = "psci";
100109
next-level-cache = <&L2_100>;
101110
qcom,freq-domain = <&cpufreq_hw 0>;
111+
clocks = <&cpufreq_hw 0>;
102112
L2_100: l2-cache {
103113
compatible = "cache";
114+
cache-unified;
115+
cache-level = <2>;
104116
next-level-cache = <&L3_0>;
105117
};
106118
};
@@ -112,8 +124,11 @@ examples:
112124
enable-method = "psci";
113125
next-level-cache = <&L2_200>;
114126
qcom,freq-domain = <&cpufreq_hw 0>;
127+
clocks = <&cpufreq_hw 0>;
115128
L2_200: l2-cache {
116129
compatible = "cache";
130+
cache-unified;
131+
cache-level = <2>;
117132
next-level-cache = <&L3_0>;
118133
};
119134
};
@@ -125,8 +140,11 @@ examples:
125140
enable-method = "psci";
126141
next-level-cache = <&L2_300>;
127142
qcom,freq-domain = <&cpufreq_hw 0>;
143+
clocks = <&cpufreq_hw 0>;
128144
L2_300: l2-cache {
129145
compatible = "cache";
146+
cache-unified;
147+
cache-level = <2>;
130148
next-level-cache = <&L3_0>;
131149
};
132150
};
@@ -138,8 +156,11 @@ examples:
138156
enable-method = "psci";
139157
next-level-cache = <&L2_400>;
140158
qcom,freq-domain = <&cpufreq_hw 1>;
159+
clocks = <&cpufreq_hw 1>;
141160
L2_400: l2-cache {
142161
compatible = "cache";
162+
cache-unified;
163+
cache-level = <2>;
143164
next-level-cache = <&L3_0>;
144165
};
145166
};
@@ -151,8 +172,11 @@ examples:
151172
enable-method = "psci";
152173
next-level-cache = <&L2_500>;
153174
qcom,freq-domain = <&cpufreq_hw 1>;
175+
clocks = <&cpufreq_hw 1>;
154176
L2_500: l2-cache {
155177
compatible = "cache";
178+
cache-unified;
179+
cache-level = <2>;
156180
next-level-cache = <&L3_0>;
157181
};
158182
};
@@ -164,8 +188,11 @@ examples:
164188
enable-method = "psci";
165189
next-level-cache = <&L2_600>;
166190
qcom,freq-domain = <&cpufreq_hw 1>;
191+
clocks = <&cpufreq_hw 1>;
167192
L2_600: l2-cache {
168193
compatible = "cache";
194+
cache-unified;
195+
cache-level = <2>;
169196
next-level-cache = <&L3_0>;
170197
};
171198
};
@@ -177,8 +204,11 @@ examples:
177204
enable-method = "psci";
178205
next-level-cache = <&L2_700>;
179206
qcom,freq-domain = <&cpufreq_hw 1>;
207+
clocks = <&cpufreq_hw 1>;
180208
L2_700: l2-cache {
181209
compatible = "cache";
210+
cache-unified;
211+
cache-level = <2>;
182212
next-level-cache = <&L3_0>;
183213
};
184214
};
@@ -197,6 +227,7 @@ examples:
197227
clock-names = "xo", "alternate";
198228
199229
#freq-domain-cells = <1>;
230+
#clock-cells = <1>;
200231
};
201232
};
202233
...

arch/arm64/boot/dts/ti/k3-am625-sk.dts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,15 @@
3131
bootargs = "console=ttyS2,115200n8 earlycon=ns16550a,mmio32,0x02800000";
3232
};
3333

34+
opp-table {
35+
/* Add 1.4GHz OPP for am625-sk board. Requires VDD_CORE to be at 0.85V */
36+
opp-1400000000 {
37+
opp-hz = /bits/ 64 <1400000000>;
38+
opp-supported-hw = <0x01 0x0004>;
39+
clock-latency-ns = <6000000>;
40+
};
41+
};
42+
3443
memory@80000000 {
3544
device_type = "memory";
3645
/* 2G RAM */

arch/arm64/boot/dts/ti/k3-am625.dtsi

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@
4848
d-cache-line-size = <64>;
4949
d-cache-sets = <128>;
5050
next-level-cache = <&L2_0>;
51+
operating-points-v2 = <&a53_opp_table>;
52+
clocks = <&k3_clks 135 0>;
5153
};
5254

5355
cpu1: cpu@1 {
@@ -62,6 +64,8 @@
6264
d-cache-line-size = <64>;
6365
d-cache-sets = <128>;
6466
next-level-cache = <&L2_0>;
67+
operating-points-v2 = <&a53_opp_table>;
68+
clocks = <&k3_clks 136 0>;
6569
};
6670

6771
cpu2: cpu@2 {
@@ -76,6 +80,8 @@
7680
d-cache-line-size = <64>;
7781
d-cache-sets = <128>;
7882
next-level-cache = <&L2_0>;
83+
operating-points-v2 = <&a53_opp_table>;
84+
clocks = <&k3_clks 137 0>;
7985
};
8086

8187
cpu3: cpu@3 {
@@ -90,6 +96,51 @@
9096
d-cache-line-size = <64>;
9197
d-cache-sets = <128>;
9298
next-level-cache = <&L2_0>;
99+
operating-points-v2 = <&a53_opp_table>;
100+
clocks = <&k3_clks 138 0>;
101+
};
102+
};
103+
104+
a53_opp_table: opp-table {
105+
compatible = "operating-points-v2-ti-cpu";
106+
opp-shared;
107+
syscon = <&wkup_conf>;
108+
109+
opp-200000000 {
110+
opp-hz = /bits/ 64 <200000000>;
111+
opp-supported-hw = <0x01 0x0007>;
112+
clock-latency-ns = <6000000>;
113+
};
114+
115+
opp-400000000 {
116+
opp-hz = /bits/ 64 <400000000>;
117+
opp-supported-hw = <0x01 0x0007>;
118+
clock-latency-ns = <6000000>;
119+
};
120+
121+
opp-600000000 {
122+
opp-hz = /bits/ 64 <600000000>;
123+
opp-supported-hw = <0x01 0x0007>;
124+
clock-latency-ns = <6000000>;
125+
};
126+
127+
opp-800000000 {
128+
opp-hz = /bits/ 64 <800000000>;
129+
opp-supported-hw = <0x01 0x0007>;
130+
clock-latency-ns = <6000000>;
131+
};
132+
133+
opp-1000000000 {
134+
opp-hz = /bits/ 64 <1000000000>;
135+
opp-supported-hw = <0x01 0x0006>;
136+
clock-latency-ns = <6000000>;
137+
};
138+
139+
opp-1250000000 {
140+
opp-hz = /bits/ 64 <1250000000>;
141+
opp-supported-hw = <0x01 0x0004>;
142+
clock-latency-ns = <6000000>;
143+
opp-suspend;
93144
};
94145
};
95146

drivers/cpufreq/Kconfig.arm

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,15 @@ config ARM_ALLWINNER_SUN50I_CPUFREQ_NVMEM
4141
To compile this driver as a module, choose M here: the
4242
module will be called sun50i-cpufreq-nvmem.
4343

44+
config ARM_APPLE_SOC_CPUFREQ
45+
tristate "Apple Silicon SoC CPUFreq support"
46+
depends on ARCH_APPLE || (COMPILE_TEST && 64BIT)
47+
select PM_OPP
48+
default ARCH_APPLE
49+
help
50+
This adds the CPUFreq driver for Apple Silicon machines
51+
(e.g. Apple M1).
52+
4453
config ARM_ARMADA_37XX_CPUFREQ
4554
tristate "Armada 37xx CPUFreq support"
4655
depends on ARCH_MVEBU && CPUFREQ_DT
@@ -340,8 +349,8 @@ config ARM_TEGRA194_CPUFREQ
340349

341350
config ARM_TI_CPUFREQ
342351
bool "Texas Instruments CPUFreq support"
343-
depends on ARCH_OMAP2PLUS
344-
default ARCH_OMAP2PLUS
352+
depends on ARCH_OMAP2PLUS || ARCH_K3
353+
default y
345354
help
346355
This driver enables valid OPPs on the running platform based on
347356
values contained within the SoC in use. Enable this in order to

drivers/cpufreq/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ obj-$(CONFIG_X86_AMD_FREQ_SENSITIVITY) += amd_freq_sensitivity.o
5252

5353
##################################################################################
5454
# ARM SoC drivers
55+
obj-$(CONFIG_ARM_APPLE_SOC_CPUFREQ) += apple-soc-cpufreq.o
5556
obj-$(CONFIG_ARM_ARMADA_37XX_CPUFREQ) += armada-37xx-cpufreq.o
5657
obj-$(CONFIG_ARM_ARMADA_8K_CPUFREQ) += armada-8k-cpufreq.o
5758
obj-$(CONFIG_ARM_BRCMSTB_AVS_CPUFREQ) += brcmstb-avs-cpufreq.o

drivers/cpufreq/acpi-cpufreq.c

Lines changed: 7 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#include <linux/compiler.h>
2020
#include <linux/dmi.h>
2121
#include <linux/slab.h>
22+
#include <linux/string_helpers.h>
2223

2324
#include <linux/acpi.h>
2425
#include <linux/io.h>
@@ -135,8 +136,8 @@ static int set_boost(struct cpufreq_policy *policy, int val)
135136
{
136137
on_each_cpu_mask(policy->cpus, boost_set_msr_each,
137138
(void *)(long)val, 1);
138-
pr_debug("CPU %*pbl: Core Boosting %sabled.\n",
139-
cpumask_pr_args(policy->cpus), val ? "en" : "dis");
139+
pr_debug("CPU %*pbl: Core Boosting %s.\n",
140+
cpumask_pr_args(policy->cpus), str_enabled_disabled(val));
140141

141142
return 0;
142143
}
@@ -535,15 +536,6 @@ static void free_acpi_perf_data(void)
535536
free_percpu(acpi_perf_data);
536537
}
537538

538-
static int cpufreq_boost_online(unsigned int cpu)
539-
{
540-
/*
541-
* On the CPU_UP path we simply keep the boost-disable flag
542-
* in sync with the current global state.
543-
*/
544-
return boost_set_msr(acpi_cpufreq_driver.boost_enabled);
545-
}
546-
547539
static int cpufreq_boost_down_prep(unsigned int cpu)
548540
{
549541
/*
@@ -897,6 +889,9 @@ static int acpi_cpufreq_cpu_init(struct cpufreq_policy *policy)
897889
if (perf->states[0].core_frequency * 1000 != freq_table[0].frequency)
898890
pr_warn(FW_WARN "P-state 0 is not max freq\n");
899891

892+
if (acpi_cpufreq_driver.set_boost)
893+
set_boost(policy, acpi_cpufreq_driver.boost_enabled);
894+
900895
return result;
901896

902897
err_unreg:
@@ -916,6 +911,7 @@ static int acpi_cpufreq_cpu_exit(struct cpufreq_policy *policy)
916911

917912
pr_debug("%s\n", __func__);
918913

914+
cpufreq_boost_down_prep(policy->cpu);
919915
policy->fast_switch_possible = false;
920916
policy->driver_data = NULL;
921917
acpi_processor_unregister_performance(data->acpi_perf_cpu);
@@ -958,37 +954,15 @@ static struct cpufreq_driver acpi_cpufreq_driver = {
958954
.attr = acpi_cpufreq_attr,
959955
};
960956

961-
static enum cpuhp_state acpi_cpufreq_online;
962-
963957
static void __init acpi_cpufreq_boost_init(void)
964958
{
965-
int ret;
966-
967959
if (!(boot_cpu_has(X86_FEATURE_CPB) || boot_cpu_has(X86_FEATURE_IDA))) {
968960
pr_debug("Boost capabilities not present in the processor\n");
969961
return;
970962
}
971963

972964
acpi_cpufreq_driver.set_boost = set_boost;
973965
acpi_cpufreq_driver.boost_enabled = boost_state(0);
974-
975-
/*
976-
* This calls the online callback on all online cpu and forces all
977-
* MSRs to the same value.
978-
*/
979-
ret = cpuhp_setup_state(CPUHP_AP_ONLINE_DYN, "cpufreq/acpi:online",
980-
cpufreq_boost_online, cpufreq_boost_down_prep);
981-
if (ret < 0) {
982-
pr_err("acpi_cpufreq: failed to register hotplug callbacks\n");
983-
return;
984-
}
985-
acpi_cpufreq_online = ret;
986-
}
987-
988-
static void acpi_cpufreq_boost_exit(void)
989-
{
990-
if (acpi_cpufreq_online > 0)
991-
cpuhp_remove_state_nocalls(acpi_cpufreq_online);
992966
}
993967

994968
static int __init acpi_cpufreq_init(void)
@@ -1032,7 +1006,6 @@ static int __init acpi_cpufreq_init(void)
10321006
ret = cpufreq_register_driver(&acpi_cpufreq_driver);
10331007
if (ret) {
10341008
free_acpi_perf_data();
1035-
acpi_cpufreq_boost_exit();
10361009
}
10371010
return ret;
10381011
}
@@ -1041,8 +1014,6 @@ static void __exit acpi_cpufreq_exit(void)
10411014
{
10421015
pr_debug("%s\n", __func__);
10431016

1044-
acpi_cpufreq_boost_exit();
1045-
10461017
cpufreq_unregister_driver(&acpi_cpufreq_driver);
10471018

10481019
free_acpi_perf_data();

drivers/cpufreq/amd_freq_sensitivity.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,8 @@ static int __init amd_freq_sensitivity_init(void)
125125
if (!pcidev) {
126126
if (!boot_cpu_has(X86_FEATURE_PROC_FEEDBACK))
127127
return -ENODEV;
128+
} else {
129+
pci_dev_put(pcidev);
128130
}
129131

130132
if (rdmsrl_safe(MSR_AMD64_FREQ_SENSITIVITY_ACTUAL, &val))

0 commit comments

Comments
 (0)