Skip to content

Commit 1774be7

Browse files
committed
Merge branch 'pm-cpufreq'
Merge cpufreq updates for 6.15-rc1: - Manage sysfs attributes and boost frequencies efficiently from cpufreq core to reduce boilerplate code from drivers (Viresh Kumar). - Minor cleanups to cpufreq drivers (Aaron Kling, Benjamin Schneider, Dhananjay Ugwekar, Imran Shaik, and zuoqian). - Migrate some cpufreq drivers to using for_each_present_cpu() (Jacky Bai). - cpufreq-qcom-hw DT binding fixes (Krzysztof Kozlowski). - Use str_enable_disable() helper in cpufreq_online() (Lifeng Zheng). - Optimize the amd-pstate driver to avoid cases where call paths end up calling the same writes multiple times and needlessly caching variables through code reorganization, locking overhaul and tracing adjustments (Mario Limonciello, Dhananjay Ugwekar). - Make it possible to avoid enabling capacity-aware scheduling (CAS) in the intel_pstate driver and relocate a check for out-of-band (OOB) platform handling in it to make it detect OOB before checking HWP availability (Rafael Wysocki). - Fix dbs_update() to avoid inadvertent conversions of negative integer values to unsigned int which causes CPU frequency selection to be inaccurate in some cases when the "conservative" cpufreq governor is in use (Jie Zhan). * pm-cpufreq: (91 commits) dt-bindings: cpufreq: cpufreq-qcom-hw: Narrow properties on SDX75, SA8775p and SM8650 dt-bindings: cpufreq: cpufreq-qcom-hw: Drop redundant minItems:1 dt-bindings: cpufreq: cpufreq-qcom-hw: Add missing constraint for interrupt-names dt-bindings: cpufreq: cpufreq-qcom-hw: Add QCS8300 compatible cpufreq: Init cpufreq only for present CPUs cpufreq: tegra186: Share policy per cluster cpufreq/amd-pstate: Drop actions in amd_pstate_epp_cpu_offline() cpufreq/amd-pstate: Stop caching EPP cpufreq/amd-pstate: Rework CPPC enabling cpufreq/amd-pstate: Drop debug statements for policy setting cpufreq/amd-pstate: Update cppc_req_cached for shared mem EPP writes cpufreq/amd-pstate: Move all EPP tracing into *_update_perf and *_set_epp functions cpufreq/amd-pstate: Cache CPPC request in shared mem case too cpufreq/amd-pstate: Replace all AMD_CPPC_* macros with masks cpufreq/amd-pstate-ut: Adjust variable scope cpufreq/amd-pstate-ut: Run on all of the correct CPUs cpufreq/amd-pstate-ut: Drop SUCCESS and FAIL enums cpufreq/amd-pstate-ut: Allow lowest nonlinear and lowest to be the same cpufreq/amd-pstate-ut: Use _free macro to free put policy cpufreq/amd-pstate: Drop `cppc_cap1_cached` ...
2 parents 80f0f07 + 7a6589f commit 1774be7

Some content is hidden

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

59 files changed

+617
-799
lines changed

Documentation/admin-guide/kernel-parameters.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2316,6 +2316,9 @@
23162316
per_cpu_perf_limits
23172317
Allow per-logical-CPU P-State performance control limits using
23182318
cpufreq sysfs interface
2319+
no_cas
2320+
Do not enable capacity-aware scheduling (CAS) on
2321+
hybrid systems
23192322

23202323
intremap= [X86-64,Intel-IOMMU,EARLY]
23212324
on enable Interrupt Remapping (default)

Documentation/admin-guide/pm/intel_pstate.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -696,6 +696,9 @@ of them have to be prepended with the ``intel_pstate=`` prefix.
696696
Use per-logical-CPU P-State limits (see `Coordination of P-state
697697
Limits`_ for details).
698698

699+
``no_cas``
700+
Do not enable capacity-aware scheduling (CAS) which is enabled by
701+
default on hybrid systems.
699702

700703
Diagnostics and Tuning
701704
======================

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

Lines changed: 31 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ properties:
3434
- description: v2 of CPUFREQ HW (EPSS)
3535
items:
3636
- enum:
37+
- qcom,qcs8300-cpufreq-epss
3738
- qcom,qdu1000-cpufreq-epss
3839
- qcom,sa8255p-cpufreq-epss
3940
- qcom,sa8775p-cpufreq-epss
@@ -111,22 +112,20 @@ allOf:
111112
enum:
112113
- qcom,qcm2290-cpufreq-hw
113114
- qcom,sar2130p-cpufreq-epss
115+
- qcom,sdx75-cpufreq-epss
114116
then:
115117
properties:
116118
reg:
117-
minItems: 1
118119
maxItems: 1
119120

120121
reg-names:
121-
minItems: 1
122122
maxItems: 1
123123

124124
interrupts:
125-
minItems: 1
126125
maxItems: 1
127126

128127
interrupt-names:
129-
minItems: 1
128+
maxItems: 1
130129

131130
- if:
132131
properties:
@@ -135,6 +134,7 @@ allOf:
135134
enum:
136135
- qcom,qdu1000-cpufreq-epss
137136
- qcom,sa8255p-cpufreq-epss
137+
- qcom,sa8775p-cpufreq-epss
138138
- qcom,sc7180-cpufreq-hw
139139
- qcom,sc8180x-cpufreq-hw
140140
- qcom,sc8280xp-cpufreq-epss
@@ -160,12 +160,14 @@ allOf:
160160

161161
interrupt-names:
162162
minItems: 2
163+
maxItems: 2
163164

164165
- if:
165166
properties:
166167
compatible:
167168
contains:
168169
enum:
170+
- qcom,qcs8300-cpufreq-epss
169171
- qcom,sc7280-cpufreq-epss
170172
- qcom,sm8250-cpufreq-epss
171173
- qcom,sm8350-cpufreq-epss
@@ -187,6 +189,7 @@ allOf:
187189

188190
interrupt-names:
189191
minItems: 3
192+
maxItems: 3
190193

191194
- if:
192195
properties:
@@ -211,7 +214,31 @@ allOf:
211214

212215
interrupt-names:
213216
minItems: 2
217+
maxItems: 2
214218

219+
- if:
220+
properties:
221+
compatible:
222+
contains:
223+
enum:
224+
- qcom,sm8650-cpufreq-epss
225+
then:
226+
properties:
227+
reg:
228+
minItems: 4
229+
maxItems: 4
230+
231+
reg-names:
232+
minItems: 4
233+
maxItems: 4
234+
235+
interrupts:
236+
minItems: 4
237+
maxItems: 4
238+
239+
interrupt-names:
240+
minItems: 4
241+
maxItems: 4
215242

216243
examples:
217244
- |

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

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -701,15 +701,17 @@
701701
#define MSR_AMD_CPPC_REQ 0xc00102b3
702702
#define MSR_AMD_CPPC_STATUS 0xc00102b4
703703

704-
#define AMD_CPPC_LOWEST_PERF(x) (((x) >> 0) & 0xff)
705-
#define AMD_CPPC_LOWNONLIN_PERF(x) (((x) >> 8) & 0xff)
706-
#define AMD_CPPC_NOMINAL_PERF(x) (((x) >> 16) & 0xff)
707-
#define AMD_CPPC_HIGHEST_PERF(x) (((x) >> 24) & 0xff)
708-
709-
#define AMD_CPPC_MAX_PERF(x) (((x) & 0xff) << 0)
710-
#define AMD_CPPC_MIN_PERF(x) (((x) & 0xff) << 8)
711-
#define AMD_CPPC_DES_PERF(x) (((x) & 0xff) << 16)
712-
#define AMD_CPPC_ENERGY_PERF_PREF(x) (((x) & 0xff) << 24)
704+
/* Masks for use with MSR_AMD_CPPC_CAP1 */
705+
#define AMD_CPPC_LOWEST_PERF_MASK GENMASK(7, 0)
706+
#define AMD_CPPC_LOWNONLIN_PERF_MASK GENMASK(15, 8)
707+
#define AMD_CPPC_NOMINAL_PERF_MASK GENMASK(23, 16)
708+
#define AMD_CPPC_HIGHEST_PERF_MASK GENMASK(31, 24)
709+
710+
/* Masks for use with MSR_AMD_CPPC_REQ */
711+
#define AMD_CPPC_MAX_PERF_MASK GENMASK(7, 0)
712+
#define AMD_CPPC_MIN_PERF_MASK GENMASK(15, 8)
713+
#define AMD_CPPC_DES_PERF_MASK GENMASK(23, 16)
714+
#define AMD_CPPC_EPP_PERF_MASK GENMASK(31, 24)
713715

714716
/* AMD Performance Counter Global Status and Control MSRs */
715717
#define MSR_AMD64_PERF_CNTR_GLOBAL_STATUS 0xc0000300

arch/x86/kernel/acpi/cppc.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
* Copyright (c) 2016, Intel Corporation.
55
*/
66

7+
#include <linux/bitfield.h>
8+
79
#include <acpi/cppc_acpi.h>
810
#include <asm/msr.h>
911
#include <asm/processor.h>
@@ -149,7 +151,7 @@ int amd_get_highest_perf(unsigned int cpu, u32 *highest_perf)
149151
if (ret)
150152
goto out;
151153

152-
val = AMD_CPPC_HIGHEST_PERF(val);
154+
val = FIELD_GET(AMD_CPPC_HIGHEST_PERF_MASK, val);
153155
} else {
154156
ret = cppc_get_highest_perf(cpu, &val);
155157
if (ret)

drivers/cpufreq/Kconfig.arm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ config ARM_TEGRA186_CPUFREQ
254254

255255
config ARM_TEGRA194_CPUFREQ
256256
tristate "Tegra194 CPUFreq support"
257-
depends on ARCH_TEGRA_194_SOC || (64BIT && COMPILE_TEST)
257+
depends on ARCH_TEGRA_194_SOC || ARCH_TEGRA_234_SOC || (64BIT && COMPILE_TEST)
258258
depends on TEGRA_BPMP
259259
default y
260260
help

drivers/cpufreq/acpi-cpufreq.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -909,6 +909,9 @@ static int acpi_cpufreq_cpu_init(struct cpufreq_policy *policy)
909909
if (perf->states[0].core_frequency * 1000 != freq_table[0].frequency)
910910
pr_warn(FW_WARN "P-state 0 is not max freq\n");
911911

912+
if (acpi_cpufreq_driver.set_boost)
913+
policy->boost_supported = true;
914+
912915
return result;
913916

914917
err_unreg:
@@ -949,7 +952,6 @@ static int acpi_cpufreq_resume(struct cpufreq_policy *policy)
949952
}
950953

951954
static struct freq_attr *acpi_cpufreq_attr[] = {
952-
&cpufreq_freq_attr_scaling_available_freqs,
953955
&freqdomain_cpus,
954956
#ifdef CONFIG_X86_ACPI_CPUFREQ_CPB
955957
&cpb,

drivers/cpufreq/amd-pstate-trace.h

Lines changed: 31 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@
2424

2525
TRACE_EVENT(amd_pstate_perf,
2626

27-
TP_PROTO(unsigned long min_perf,
28-
unsigned long target_perf,
29-
unsigned long capacity,
27+
TP_PROTO(u8 min_perf,
28+
u8 target_perf,
29+
u8 capacity,
3030
u64 freq,
3131
u64 mperf,
3232
u64 aperf,
@@ -47,9 +47,9 @@ TRACE_EVENT(amd_pstate_perf,
4747
),
4848

4949
TP_STRUCT__entry(
50-
__field(unsigned long, min_perf)
51-
__field(unsigned long, target_perf)
52-
__field(unsigned long, capacity)
50+
__field(u8, min_perf)
51+
__field(u8, target_perf)
52+
__field(u8, capacity)
5353
__field(unsigned long long, freq)
5454
__field(unsigned long long, mperf)
5555
__field(unsigned long long, aperf)
@@ -70,10 +70,10 @@ TRACE_EVENT(amd_pstate_perf,
7070
__entry->fast_switch = fast_switch;
7171
),
7272

73-
TP_printk("amd_min_perf=%lu amd_des_perf=%lu amd_max_perf=%lu freq=%llu mperf=%llu aperf=%llu tsc=%llu cpu_id=%u fast_switch=%s",
74-
(unsigned long)__entry->min_perf,
75-
(unsigned long)__entry->target_perf,
76-
(unsigned long)__entry->capacity,
73+
TP_printk("amd_min_perf=%hhu amd_des_perf=%hhu amd_max_perf=%hhu freq=%llu mperf=%llu aperf=%llu tsc=%llu cpu_id=%u fast_switch=%s",
74+
(u8)__entry->min_perf,
75+
(u8)__entry->target_perf,
76+
(u8)__entry->capacity,
7777
(unsigned long long)__entry->freq,
7878
(unsigned long long)__entry->mperf,
7979
(unsigned long long)__entry->aperf,
@@ -86,27 +86,30 @@ TRACE_EVENT(amd_pstate_perf,
8686
TRACE_EVENT(amd_pstate_epp_perf,
8787

8888
TP_PROTO(unsigned int cpu_id,
89-
unsigned int highest_perf,
90-
unsigned int epp,
91-
unsigned int min_perf,
92-
unsigned int max_perf,
93-
bool boost
89+
u8 highest_perf,
90+
u8 epp,
91+
u8 min_perf,
92+
u8 max_perf,
93+
bool boost,
94+
bool changed
9495
),
9596

9697
TP_ARGS(cpu_id,
9798
highest_perf,
9899
epp,
99100
min_perf,
100101
max_perf,
101-
boost),
102+
boost,
103+
changed),
102104

103105
TP_STRUCT__entry(
104106
__field(unsigned int, cpu_id)
105-
__field(unsigned int, highest_perf)
106-
__field(unsigned int, epp)
107-
__field(unsigned int, min_perf)
108-
__field(unsigned int, max_perf)
107+
__field(u8, highest_perf)
108+
__field(u8, epp)
109+
__field(u8, min_perf)
110+
__field(u8, max_perf)
109111
__field(bool, boost)
112+
__field(bool, changed)
110113
),
111114

112115
TP_fast_assign(
@@ -116,15 +119,17 @@ TRACE_EVENT(amd_pstate_epp_perf,
116119
__entry->min_perf = min_perf;
117120
__entry->max_perf = max_perf;
118121
__entry->boost = boost;
122+
__entry->changed = changed;
119123
),
120124

121-
TP_printk("cpu%u: [%u<->%u]/%u, epp=%u, boost=%u",
125+
TP_printk("cpu%u: [%hhu<->%hhu]/%hhu, epp=%hhu, boost=%u, changed=%u",
122126
(unsigned int)__entry->cpu_id,
123-
(unsigned int)__entry->min_perf,
124-
(unsigned int)__entry->max_perf,
125-
(unsigned int)__entry->highest_perf,
126-
(unsigned int)__entry->epp,
127-
(bool)__entry->boost
127+
(u8)__entry->min_perf,
128+
(u8)__entry->max_perf,
129+
(u8)__entry->highest_perf,
130+
(u8)__entry->epp,
131+
(bool)__entry->boost,
132+
(bool)__entry->changed
128133
)
129134
);
130135

0 commit comments

Comments
 (0)