diff options
author | Olof Johansson <[email protected]> | 2019-12-09 09:17:09 -0800 |
---|---|---|
committer | Olof Johansson <[email protected]> | 2019-12-09 09:17:10 -0800 |
commit | df4a6ff19224b5434237e781979fbace0a7feebd (patch) | |
tree | 943f7f0be761d5456c7ffd7b4910277170ab6b05 | |
parent | e42617b825f8073569da76dc4510bfa019b1c35a (diff) | |
parent | c9385887cbbf292ee367f75b400874f00ea34890 (diff) |
Merge tag 'vexpress-fixes-5.5' of git://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux into arm/fixes
ARMv7 Vexpress fixes for v5.5
Switching the cpumask from topology core to OPP sharing, as the topology
core cpumask can be modified during cpu hotplug to avoid setting up
wrong cpufreq policy cpumask.
* tag 'vexpress-fixes-5.5' of git://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux:
cpufreq: vexpress-spc: Switch cpumask from topology core to OPP sharing
ARM: vexpress: Set-up shared OPP table instead of individual for each CPU
Link: https://lore.kernel.org/r/20191209140037.GC25155@bogus
Signed-off-by: Olof Johansson <[email protected]>
-rw-r--r-- | arch/arm/mach-vexpress/spc.c | 12 | ||||
-rw-r--r-- | drivers/cpufreq/vexpress-spc-cpufreq.c | 2 |
2 files changed, 12 insertions, 2 deletions
diff --git a/arch/arm/mach-vexpress/spc.c b/arch/arm/mach-vexpress/spc.c index 354e0e7025ae..1da11bdb1dfb 100644 --- a/arch/arm/mach-vexpress/spc.c +++ b/arch/arm/mach-vexpress/spc.c @@ -551,8 +551,9 @@ static struct clk *ve_spc_clk_register(struct device *cpu_dev) static int __init ve_spc_clk_init(void) { - int cpu; + int cpu, cluster; struct clk *clk; + bool init_opp_table[MAX_CLUSTERS] = { false }; if (!info) return 0; /* Continue only if SPC is initialised */ @@ -578,8 +579,17 @@ static int __init ve_spc_clk_init(void) continue; } + cluster = topology_physical_package_id(cpu_dev->id); + if (init_opp_table[cluster]) + continue; + if (ve_init_opp_table(cpu_dev)) pr_warn("failed to initialise cpu%d opp table\n", cpu); + else if (dev_pm_opp_set_sharing_cpus(cpu_dev, + topology_core_cpumask(cpu_dev->id))) + pr_warn("failed to mark OPPs shared for cpu%d\n", cpu); + else + init_opp_table[cluster] = true; } platform_device_register_simple("vexpress-spc-cpufreq", -1, NULL, 0); diff --git a/drivers/cpufreq/vexpress-spc-cpufreq.c b/drivers/cpufreq/vexpress-spc-cpufreq.c index 506e3f2bf53a..83c85d3d67e3 100644 --- a/drivers/cpufreq/vexpress-spc-cpufreq.c +++ b/drivers/cpufreq/vexpress-spc-cpufreq.c @@ -434,7 +434,7 @@ static int ve_spc_cpufreq_init(struct cpufreq_policy *policy) if (cur_cluster < MAX_CLUSTERS) { int cpu; - cpumask_copy(policy->cpus, topology_core_cpumask(policy->cpu)); + dev_pm_opp_get_sharing_cpus(cpu_dev, policy->cpus); for_each_cpu(cpu, policy->cpus) per_cpu(physical_cluster, cpu) = cur_cluster; |