Skip to content

Commit 6af3aab

Browse files
committed
Merge tag 'cpufreq-arm-updates-6.12' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/vireshk/pm
Merge ARM cpufreq updates for 6.12 from Viresh Kumar: "- Several OF related cleanups in cpufreq drivers (Rob Herring). - Enable COMPILE_TEST for ARM drivers (Rob Herrring). - Introduce quirks for syscon failures and use socinfo to get revision for TI cpufreq driver (Dhruva Gole and Nishanth Menon). - Minor cleanups in amd-pstate driver (Anastasia Belova and Dhananjay Ugwekar). - Minor cleanups for loongson, cpufreq-dt and powernv cpufreq drivers (Danila Tikhonov, Huacai Chen, and Liu Jing)." * tag 'cpufreq-arm-updates-6.12' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/vireshk/pm: cpufreq: ti-cpufreq: Use socinfo to get revision in AM62 family cpufreq: Fix the cacography in powernv-cpufreq.c cpufreq: ti-cpufreq: Introduce quirks to handle syscon fails appropriately cpufreq: loongson3: Use raw_smp_processor_id() in do_service_request() cpufreq: amd-pstate: add check for cpufreq_cpu_get's return value cpufreq: Add SM7325 to cpufreq-dt-platdev blocklist cpufreq: Fix warning on unused of_device_id tables for !CONFIG_OF cpufreq/amd-pstate: Add the missing cpufreq_cpu_put() cpufreq: Drop CONFIG_ARM and CONFIG_ARM64 dependency on Arm drivers cpufreq: Enable COMPILE_TEST on Arm drivers cpufreq: armada-8k: Avoid excessive stack usage cpufreq: omap: Drop asm includes cpufreq: qcom: Add explicit io.h include for readl/writel_relaxed cpufreq: spear: Use of_property_for_each_u32() instead of open coding cpufreq: Use of_property_present()
2 parents 222caf5 + 6b612d1 commit 6af3aab

18 files changed

+95
-59
lines changed

drivers/cpufreq/Kconfig

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -231,9 +231,7 @@ if X86
231231
source "drivers/cpufreq/Kconfig.x86"
232232
endif
233233

234-
if ARM || ARM64
235234
source "drivers/cpufreq/Kconfig.arm"
236-
endif
237235

238236
if PPC32 || PPC64
239237
source "drivers/cpufreq/Kconfig.powerpc"

drivers/cpufreq/Kconfig.arm

Lines changed: 30 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
config ARM_ALLWINNER_SUN50I_CPUFREQ_NVMEM
77
tristate "Allwinner nvmem based SUN50I CPUFreq driver"
8-
depends on ARCH_SUNXI
8+
depends on ARCH_SUNXI || COMPILE_TEST
99
depends on NVMEM_SUNXI_SID
1010
select PM_OPP
1111
help
@@ -26,15 +26,17 @@ config ARM_APPLE_SOC_CPUFREQ
2626

2727
config ARM_ARMADA_37XX_CPUFREQ
2828
tristate "Armada 37xx CPUFreq support"
29-
depends on ARCH_MVEBU && CPUFREQ_DT
29+
depends on ARCH_MVEBU || COMPILE_TEST
30+
depends on CPUFREQ_DT
3031
help
3132
This adds the CPUFreq driver support for Marvell Armada 37xx SoCs.
3233
The Armada 37xx PMU supports 4 frequency and VDD levels.
3334

3435
config ARM_ARMADA_8K_CPUFREQ
3536
tristate "Armada 8K CPUFreq driver"
36-
depends on ARCH_MVEBU && CPUFREQ_DT
37-
select ARMADA_AP_CPU_CLK
37+
depends on ARCH_MVEBU || COMPILE_TEST
38+
depends on CPUFREQ_DT
39+
select ARMADA_AP_CPU_CLK if COMMON_CLK
3840
help
3941
This enables the CPUFreq driver support for Marvell
4042
Armada8k SOCs.
@@ -56,7 +58,7 @@ config ARM_SCPI_CPUFREQ
5658
config ARM_VEXPRESS_SPC_CPUFREQ
5759
tristate "Versatile Express SPC based CPUfreq driver"
5860
depends on ARM_CPU_TOPOLOGY && HAVE_CLK
59-
depends on ARCH_VEXPRESS_SPC
61+
depends on ARCH_VEXPRESS_SPC || COMPILE_TEST
6062
select PM_OPP
6163
help
6264
This add the CPUfreq driver support for Versatile Express
@@ -75,7 +77,8 @@ config ARM_BRCMSTB_AVS_CPUFREQ
7577

7678
config ARM_HIGHBANK_CPUFREQ
7779
tristate "Calxeda Highbank-based"
78-
depends on ARCH_HIGHBANK && CPUFREQ_DT && REGULATOR
80+
depends on ARCH_HIGHBANK || COMPILE_TEST
81+
depends on CPUFREQ_DT && REGULATOR && PL320_MBOX
7982
default m
8083
help
8184
This adds the CPUFreq driver for Calxeda Highbank SoC
@@ -96,7 +99,8 @@ config ARM_IMX6Q_CPUFREQ
9699

97100
config ARM_IMX_CPUFREQ_DT
98101
tristate "Freescale i.MX8M cpufreq support"
99-
depends on ARCH_MXC && CPUFREQ_DT
102+
depends on CPUFREQ_DT
103+
depends on ARCH_MXC || COMPILE_TEST
100104
help
101105
This adds cpufreq driver support for Freescale i.MX7/i.MX8M
102106
series SoCs, based on cpufreq-dt.
@@ -111,7 +115,8 @@ config ARM_KIRKWOOD_CPUFREQ
111115

112116
config ARM_MEDIATEK_CPUFREQ
113117
tristate "CPU Frequency scaling support for MediaTek SoCs"
114-
depends on ARCH_MEDIATEK && REGULATOR
118+
depends on ARCH_MEDIATEK || COMPILE_TEST
119+
depends on REGULATOR
115120
select PM_OPP
116121
help
117122
This adds the CPUFreq driver support for MediaTek SoCs.
@@ -130,12 +135,12 @@ config ARM_MEDIATEK_CPUFREQ_HW
130135

131136
config ARM_OMAP2PLUS_CPUFREQ
132137
bool "TI OMAP2+"
133-
depends on ARCH_OMAP2PLUS
138+
depends on ARCH_OMAP2PLUS || COMPILE_TEST
134139
default ARCH_OMAP2PLUS
135140

136141
config ARM_QCOM_CPUFREQ_NVMEM
137142
tristate "Qualcomm nvmem based CPUFreq"
138-
depends on ARCH_QCOM
143+
depends on ARCH_QCOM || COMPILE_TEST
139144
depends on NVMEM_QCOM_QFPROM
140145
depends on QCOM_SMEM
141146
select PM_OPP
@@ -166,7 +171,7 @@ config ARM_RASPBERRYPI_CPUFREQ
166171

167172
config ARM_S3C64XX_CPUFREQ
168173
bool "Samsung S3C64XX"
169-
depends on CPU_S3C6410
174+
depends on CPU_S3C6410 || COMPILE_TEST
170175
default y
171176
help
172177
This adds the CPUFreq driver for Samsung S3C6410 SoC.
@@ -175,7 +180,7 @@ config ARM_S3C64XX_CPUFREQ
175180

176181
config ARM_S5PV210_CPUFREQ
177182
bool "Samsung S5PV210 and S5PC110"
178-
depends on CPU_S5PV210
183+
depends on CPU_S5PV210 || COMPILE_TEST
179184
default y
180185
help
181186
This adds the CPUFreq driver for Samsung S5PV210 and
@@ -199,14 +204,15 @@ config ARM_SCMI_CPUFREQ
199204

200205
config ARM_SPEAR_CPUFREQ
201206
bool "SPEAr CPUFreq support"
202-
depends on PLAT_SPEAR
207+
depends on PLAT_SPEAR || COMPILE_TEST
203208
default y
204209
help
205210
This adds the CPUFreq driver support for SPEAr SOCs.
206211

207212
config ARM_STI_CPUFREQ
208213
tristate "STi CPUFreq support"
209-
depends on CPUFREQ_DT && SOC_STIH407
214+
depends on CPUFREQ_DT
215+
depends on SOC_STIH407 || COMPILE_TEST
210216
help
211217
This driver uses the generic OPP framework to match the running
212218
platform with a predefined set of suitable values. If not provided
@@ -216,34 +222,38 @@ config ARM_STI_CPUFREQ
216222

217223
config ARM_TEGRA20_CPUFREQ
218224
tristate "Tegra20/30 CPUFreq support"
219-
depends on ARCH_TEGRA && CPUFREQ_DT
225+
depends on ARCH_TEGRA || COMPILE_TEST
226+
depends on CPUFREQ_DT
220227
default y
221228
help
222229
This adds the CPUFreq driver support for Tegra20/30 SOCs.
223230

224231
config ARM_TEGRA124_CPUFREQ
225232
bool "Tegra124 CPUFreq support"
226-
depends on ARCH_TEGRA && CPUFREQ_DT
233+
depends on ARCH_TEGRA || COMPILE_TEST
234+
depends on CPUFREQ_DT
227235
default y
228236
help
229237
This adds the CPUFreq driver support for Tegra124 SOCs.
230238

231239
config ARM_TEGRA186_CPUFREQ
232240
tristate "Tegra186 CPUFreq support"
233-
depends on ARCH_TEGRA && TEGRA_BPMP
241+
depends on ARCH_TEGRA || COMPILE_TEST
242+
depends on TEGRA_BPMP
234243
help
235244
This adds the CPUFreq driver support for Tegra186 SOCs.
236245

237246
config ARM_TEGRA194_CPUFREQ
238247
tristate "Tegra194 CPUFreq support"
239-
depends on ARCH_TEGRA_194_SOC && TEGRA_BPMP
248+
depends on ARCH_TEGRA_194_SOC || (64BIT && COMPILE_TEST)
249+
depends on TEGRA_BPMP
240250
default y
241251
help
242252
This adds CPU frequency driver support for Tegra194 SOCs.
243253

244254
config ARM_TI_CPUFREQ
245255
bool "Texas Instruments CPUFreq support"
246-
depends on ARCH_OMAP2PLUS || ARCH_K3
256+
depends on ARCH_OMAP2PLUS || ARCH_K3 || COMPILE_TEST
247257
default y
248258
help
249259
This driver enables valid OPPs on the running platform based on
@@ -255,7 +265,7 @@ config ARM_TI_CPUFREQ
255265

256266
config ARM_PXA2xx_CPUFREQ
257267
tristate "Intel PXA2xx CPUfreq driver"
258-
depends on PXA27x || PXA25x
268+
depends on PXA27x || PXA25x || COMPILE_TEST
259269
help
260270
This add the CPUFreq driver support for Intel PXA2xx SOCs.
261271

drivers/cpufreq/amd-pstate.c

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -554,12 +554,15 @@ static void amd_pstate_update(struct amd_cpudata *cpudata, u32 min_perf,
554554
}
555555

556556
if (value == prev)
557-
return;
557+
goto cpufreq_policy_put;
558558

559559
WRITE_ONCE(cpudata->cppc_req_cached, value);
560560

561561
amd_pstate_update_perf(cpudata, min_perf, des_perf,
562562
max_perf, fast_switch);
563+
564+
cpufreq_policy_put:
565+
cpufreq_cpu_put(policy);
563566
}
564567

565568
static int amd_pstate_verify(struct cpufreq_policy_data *policy)
@@ -656,7 +659,12 @@ static void amd_pstate_adjust_perf(unsigned int cpu,
656659
unsigned long max_perf, min_perf, des_perf,
657660
cap_perf, lowest_nonlinear_perf;
658661
struct cpufreq_policy *policy = cpufreq_cpu_get(cpu);
659-
struct amd_cpudata *cpudata = policy->driver_data;
662+
struct amd_cpudata *cpudata;
663+
664+
if (!policy)
665+
return;
666+
667+
cpudata = policy->driver_data;
660668

661669
if (policy->min != cpudata->min_limit_freq || policy->max != cpudata->max_limit_freq)
662670
amd_pstate_update_min_max_limit(policy);
@@ -870,11 +878,16 @@ static void amd_pstate_init_prefcore(struct amd_cpudata *cpudata)
870878
static void amd_pstate_update_limits(unsigned int cpu)
871879
{
872880
struct cpufreq_policy *policy = cpufreq_cpu_get(cpu);
873-
struct amd_cpudata *cpudata = policy->driver_data;
881+
struct amd_cpudata *cpudata;
874882
u32 prev_high = 0, cur_high = 0;
875883
int ret;
876884
bool highest_perf_changed = false;
877885

886+
if (!policy)
887+
return;
888+
889+
cpudata = policy->driver_data;
890+
878891
mutex_lock(&amd_pstate_driver_lock);
879892
if ((!amd_pstate_prefcore) || (!cpudata->hw_prefcore))
880893
goto free_cpufreq_put;

drivers/cpufreq/apple-soc-cpufreq.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ static const struct apple_soc_cpufreq_info soc_default_info = {
8585
.cur_pstate_mask = 0, /* fallback */
8686
};
8787

88-
static const struct of_device_id apple_soc_cpufreq_of_match[] = {
88+
static const struct of_device_id apple_soc_cpufreq_of_match[] __maybe_unused = {
8989
{
9090
.compatible = "apple,t8103-cluster-cpufreq",
9191
.data = &soc_t8103_info,

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ static int __init armada_8k_cpufreq_init(void)
132132
int ret = 0, opps_index = 0, cpu, nb_cpus;
133133
struct freq_table *freq_tables;
134134
struct device_node *node;
135-
struct cpumask cpus;
135+
static struct cpumask cpus;
136136

137137
node = of_find_matching_node_and_match(NULL, armada_8k_cpufreq_of_match,
138138
NULL);

drivers/cpufreq/cpufreq-dt-platdev.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,7 @@ static const struct of_device_id blocklist[] __initconst = {
166166
{ .compatible = "qcom,sm6350", },
167167
{ .compatible = "qcom,sm6375", },
168168
{ .compatible = "qcom,sm7225", },
169+
{ .compatible = "qcom,sm7325", },
169170
{ .compatible = "qcom,sm8150", },
170171
{ .compatible = "qcom,sm8250", },
171172
{ .compatible = "qcom,sm8350", },

drivers/cpufreq/cpufreq-dt.c

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -69,22 +69,17 @@ static int set_target(struct cpufreq_policy *policy, unsigned int index)
6969
static const char *find_supply_name(struct device *dev)
7070
{
7171
struct device_node *np __free(device_node) = of_node_get(dev->of_node);
72-
struct property *pp;
7372
int cpu = dev->id;
7473

7574
/* This must be valid for sure */
7675
if (WARN_ON(!np))
7776
return NULL;
7877

7978
/* Try "cpu0" for older DTs */
80-
if (!cpu) {
81-
pp = of_find_property(np, "cpu0-supply", NULL);
82-
if (pp)
83-
return "cpu0";
84-
}
79+
if (!cpu && of_property_present(np, "cpu0-supply"))
80+
return "cpu0";
8581

86-
pp = of_find_property(np, "cpu-supply", NULL);
87-
if (pp)
82+
if (of_property_present(np, "cpu-supply"))
8883
return "cpu";
8984

9085
dev_dbg(dev, "no regulator for cpu%d\n", cpu);

drivers/cpufreq/loongson3_cpufreq.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ static DEFINE_PER_CPU(struct loongson3_freq_data *, freq_data);
176176
static inline int do_service_request(u32 id, u32 info, u32 cmd, u32 val, u32 extra)
177177
{
178178
int retries;
179-
unsigned int cpu = smp_processor_id();
179+
unsigned int cpu = raw_smp_processor_id();
180180
unsigned int package = cpu_data[cpu].package;
181181
union smc_message msg, last;
182182

drivers/cpufreq/mediatek-cpufreq.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -738,7 +738,7 @@ static const struct mtk_cpufreq_platform_data mt8516_platform_data = {
738738
};
739739

740740
/* List of machines supported by this driver */
741-
static const struct of_device_id mtk_cpufreq_machines[] __initconst = {
741+
static const struct of_device_id mtk_cpufreq_machines[] __initconst __maybe_unused = {
742742
{ .compatible = "mediatek,mt2701", .data = &mt2701_platform_data },
743743
{ .compatible = "mediatek,mt2712", .data = &mt2701_platform_data },
744744
{ .compatible = "mediatek,mt7622", .data = &mt7622_platform_data },

drivers/cpufreq/omap-cpufreq.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,6 @@
2828
#include <linux/platform_device.h>
2929
#include <linux/regulator/consumer.h>
3030

31-
#include <asm/smp_plat.h>
32-
#include <asm/cpu.h>
33-
3431
/* OPP tolerance in percentage */
3532
#define OPP_TOLERANCE 4
3633

0 commit comments

Comments
 (0)