2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2024-12-29 15:43:59 +08:00

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.
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEEunHlEgbzHrJD3ZPhAEG6vDF+4pgFAl3uPAcACgkQAEG6vDF+
 4phy/RAAvb5RI1sa0axFyJ2l2Fbh2mqV7m/95R0ztoHRV4x1eohABBcOLBMZNSV/
 FlXCYXHbyI6++GjsEoP8pu6xuiHEhP8fYeaH15oNsPWk5lg1tg5j56xq7QhjG4wE
 tF4qt9fpLj2vsmIbhUpO3RpFKTZvC6aLgBm9HpsosogE9b3vJnvTSk4ab0PmZlem
 FAAmgVnoxdApimO7bkfby+aeuhjp8wI4bCKJpQwmRsKFMbYqDH364nRirXyykerG
 U7Hw6ALrw5HxkXKt5o2AL4OI+b7/HqgN0LuFynxdnbNR+HKcOrx3ZAOTri0colOA
 PL6JL/3n7VFr0fRxzUqfNFkxnU6efDcF1AObau4OLQ0SlzQ7MaHX+Ei8ebFPF0/z
 99N9bhAYqmFwkkcojo/t4CiUNt8wkNAJ2/ZS941vag8qjio2rzaMVYMZTBysl0eF
 1FH9Vwk//hazTC7vlnsr/NLHamcvGWNgIqvZDV69NydvmwlJM8M9VyECNO89Hcwg
 bjWsimfKbhTqWh3ogcPvNcClyd8SWAZ3LkDBqaM8BrKUXfIqTBLOqDSHD3xVPvVF
 IahC5wzSZX8+vQLOHCvbbgFU6ezNZ+Uy8yny7uXiKOcw8pZ2BJzsJoY3C5CVTN2a
 60roxIGnQ2y8g2/zaj7VzMXni68R87B4Ci6Y/FGCVmu4dJaRy2I=
 =Bq/A
 -----END PGP SIGNATURE-----

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 <olof@lixom.net>
This commit is contained in:
Olof Johansson 2019-12-09 09:17:09 -08:00
commit df4a6ff192
2 changed files with 12 additions and 2 deletions

View File

@ -551,8 +551,9 @@ static struct clk *ve_spc_clk_register(struct device *cpu_dev)
static int __init ve_spc_clk_init(void) static int __init ve_spc_clk_init(void)
{ {
int cpu; int cpu, cluster;
struct clk *clk; struct clk *clk;
bool init_opp_table[MAX_CLUSTERS] = { false };
if (!info) if (!info)
return 0; /* Continue only if SPC is initialised */ return 0; /* Continue only if SPC is initialised */
@ -578,8 +579,17 @@ static int __init ve_spc_clk_init(void)
continue; continue;
} }
cluster = topology_physical_package_id(cpu_dev->id);
if (init_opp_table[cluster])
continue;
if (ve_init_opp_table(cpu_dev)) if (ve_init_opp_table(cpu_dev))
pr_warn("failed to initialise cpu%d opp table\n", cpu); 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); platform_device_register_simple("vexpress-spc-cpufreq", -1, NULL, 0);

View File

@ -434,7 +434,7 @@ static int ve_spc_cpufreq_init(struct cpufreq_policy *policy)
if (cur_cluster < MAX_CLUSTERS) { if (cur_cluster < MAX_CLUSTERS) {
int cpu; 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) for_each_cpu(cpu, policy->cpus)
per_cpu(physical_cluster, cpu) = cur_cluster; per_cpu(physical_cluster, cpu) = cur_cluster;