Skip to content

Commit 7a6589f

Browse files
committed
Merge tag 'cpufreq-arm-updates-6.15' of git://git.kernel.org/pub/scm/linux/kernel/git/vireshk/pm
Merge ARM cpufreq updates for 6.15 from Viresh Kumar: "- 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 to using for_each_present_cpu (Jacky Bai). - cpufreq-qcom-hw DT binding fixes (Krzysztof Kozlowski). - Use str_enable_disable() helper (Lifeng Zheng)." * tag 'cpufreq-arm-updates-6.15' of git://git.kernel.org/pub/scm/linux/kernel/git/vireshk/pm: (59 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: tegra194: Allow building for Tegra234 cpufreq: enable 1200Mhz clock speed for armada-37xx cpufreq: Remove cpufreq_enable_boost_support() cpufreq: staticize policy_has_boost_freq() cpufreq: qcom: Set .set_boost directly cpufreq: dt: Set .set_boost directly cpufreq: scmi: Set .set_boost directly cpufreq: powernv: Set .set_boost directly cpufreq: loongson: Set .set_boost directly cpufreq: apple: Set .set_boost directly cpufreq: Restrict enabling boost on policies with no boost frequencies cpufreq: cppc: Set policy->boost_supported cpufreq: amd: Set policy->boost_supported cpufreq: acpi: Set policy->boost_supported ...
2 parents 7983a0b + 169b9b1 commit 7a6589f

Some content is hidden

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

50 files changed

+109
-203
lines changed

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
- |

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.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -997,7 +997,7 @@ static int amd_pstate_cpu_init(struct cpufreq_policy *policy)
997997
if (ret)
998998
goto free_cpudata1;
999999

1000-
policy->boost_enabled = READ_ONCE(cpudata->boost_supported);
1000+
policy->boost_supported = READ_ONCE(cpudata->boost_supported);
10011001

10021002
/* It will be updated by governor */
10031003
policy->cur = policy->cpuinfo.min_freq;
@@ -1475,7 +1475,7 @@ static int amd_pstate_epp_cpu_init(struct cpufreq_policy *policy)
14751475
policy->cur = policy->cpuinfo.min_freq;
14761476

14771477

1478-
policy->boost_enabled = READ_ONCE(cpudata->boost_supported);
1478+
policy->boost_supported = READ_ONCE(cpudata->boost_supported);
14791479

14801480
/*
14811481
* Set the policy to provide a valid fallback value in case

drivers/cpufreq/apple-soc-cpufreq.c

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -229,12 +229,6 @@ static int apple_soc_cpufreq_find_cluster(struct cpufreq_policy *policy,
229229
return 0;
230230
}
231231

232-
static struct freq_attr *apple_soc_cpufreq_hw_attr[] = {
233-
&cpufreq_freq_attr_scaling_available_freqs,
234-
NULL, /* Filled in below if boost is enabled */
235-
NULL,
236-
};
237-
238232
static int apple_soc_cpufreq_init(struct cpufreq_policy *policy)
239233
{
240234
int ret, i;
@@ -316,16 +310,6 @@ static int apple_soc_cpufreq_init(struct cpufreq_policy *policy)
316310
policy->fast_switch_possible = true;
317311
policy->suspend_freq = freq_table[0].frequency;
318312

319-
if (policy_has_boost_freq(policy)) {
320-
ret = cpufreq_enable_boost_support();
321-
if (ret) {
322-
dev_warn(cpu_dev, "failed to enable boost: %d\n", ret);
323-
} else {
324-
apple_soc_cpufreq_hw_attr[1] = &cpufreq_freq_attr_scaling_boost_freqs;
325-
apple_soc_cpufreq_driver.boost_enabled = true;
326-
}
327-
}
328-
329313
return 0;
330314

331315
out_free_cpufreq_table:
@@ -360,7 +344,7 @@ static struct cpufreq_driver apple_soc_cpufreq_driver = {
360344
.target_index = apple_soc_cpufreq_set_target,
361345
.fast_switch = apple_soc_cpufreq_fast_switch,
362346
.register_em = cpufreq_register_em_with_opp,
363-
.attr = apple_soc_cpufreq_hw_attr,
347+
.set_boost = cpufreq_boost_set_sw,
364348
.suspend = cpufreq_generic_suspend,
365349
};
366350

drivers/cpufreq/armada-37xx-cpufreq.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -102,11 +102,7 @@ struct armada_37xx_dvfs {
102102
};
103103

104104
static struct armada_37xx_dvfs armada_37xx_dvfs[] = {
105-
/*
106-
* The cpufreq scaling for 1.2 GHz variant of the SOC is currently
107-
* unstable because we do not know how to configure it properly.
108-
*/
109-
/* {.cpu_freq_max = 1200*1000*1000, .divider = {1, 2, 4, 6} }, */
105+
{.cpu_freq_max = 1200*1000*1000, .divider = {1, 2, 4, 6} },
110106
{.cpu_freq_max = 1000*1000*1000, .divider = {1, 2, 4, 5} },
111107
{.cpu_freq_max = 800*1000*1000, .divider = {1, 2, 3, 4} },
112108
{.cpu_freq_max = 600*1000*1000, .divider = {2, 4, 5, 6} },

drivers/cpufreq/armada-8k-cpufreq.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ static void __init armada_8k_get_sharing_cpus(struct clk *cur_clk,
4747
{
4848
int cpu;
4949

50-
for_each_possible_cpu(cpu) {
50+
for_each_present_cpu(cpu) {
5151
struct device *cpu_dev;
5252
struct clk *clk;
5353

drivers/cpufreq/bmips-cpufreq.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,6 @@ static struct cpufreq_driver bmips_cpufreq_driver = {
150150
.get = bmips_cpufreq_get,
151151
.init = bmips_cpufreq_init,
152152
.exit = bmips_cpufreq_exit,
153-
.attr = cpufreq_generic_attr,
154153
.name = BMIPS_CPUFREQ_PREFIX,
155154
};
156155

drivers/cpufreq/brcmstb-avs-cpufreq.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -720,7 +720,6 @@ cpufreq_freq_attr_ro(brcm_avs_voltage);
720720
cpufreq_freq_attr_ro(brcm_avs_frequency);
721721

722722
static struct freq_attr *brcm_avs_cpufreq_attr[] = {
723-
&cpufreq_freq_attr_scaling_available_freqs,
724723
&brcm_avs_pstate,
725724
&brcm_avs_mode,
726725
&brcm_avs_pmap,

drivers/cpufreq/cppc_cpufreq.c

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,6 @@
3434
*/
3535
static LIST_HEAD(cpu_data_list);
3636

37-
static bool boost_supported;
38-
3937
static struct cpufreq_driver cppc_cpufreq_driver;
4038

4139
#ifdef CONFIG_ACPI_CPPC_CPUFREQ_FIE
@@ -653,7 +651,7 @@ static int cppc_cpufreq_cpu_init(struct cpufreq_policy *policy)
653651
* is supported.
654652
*/
655653
if (caps->highest_perf > caps->nominal_perf)
656-
boost_supported = true;
654+
policy->boost_supported = true;
657655

658656
/* Set policy->cur to max now. The governors will adjust later. */
659657
policy->cur = cppc_perf_to_khz(caps, caps->highest_perf);
@@ -791,11 +789,6 @@ static int cppc_cpufreq_set_boost(struct cpufreq_policy *policy, int state)
791789
struct cppc_perf_caps *caps = &cpu_data->perf_caps;
792790
int ret;
793791

794-
if (!boost_supported) {
795-
pr_err("BOOST not supported by CPU or firmware\n");
796-
return -EINVAL;
797-
}
798-
799792
if (state)
800793
policy->max = cppc_perf_to_khz(caps, caps->highest_perf);
801794
else

0 commit comments

Comments
 (0)