mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +00:00
MIPS: Unify checks for sibling CPUs
Up until now we have open-coded checks for whether CPUs are siblings, with slight variations on whether we consider the package ID or not. This will only get more complex when we introduce cluster support, so in preparation for that this patch introduces a cpus_are_siblings() function which can be used to check whether or not 2 CPUs are siblings in a consistent manner. By checking globalnumber with the VP ID masked out this also has the neat side effect of being ready for multi-cluster systems already. Signed-off-by: Paul Burton <paul.burton@imgtec.com> Acked-by: Rafael J. Wysocki <rjw@rjwysocki.net> Acked-by: Thomas Gleixner <tglx@linutronix.de> Cc: linux-mips@linux-mips.org Patchwork: https://patchwork.linux-mips.org/patch/17011/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
This commit is contained in:
parent
856fbcee60
commit
fe7a38c625
5 changed files with 28 additions and 13 deletions
|
@ -147,7 +147,7 @@ static void __init cps_prepare_cpus(unsigned int max_cpus)
|
|||
cpu_has_dc_aliases ? "dcache aliasing" : "");
|
||||
|
||||
for_each_present_cpu(c) {
|
||||
if (cpu_core(&cpu_data[c]))
|
||||
if (!cpus_are_siblings(smp_processor_id(), c))
|
||||
set_cpu_present(c, false);
|
||||
}
|
||||
}
|
||||
|
@ -319,10 +319,10 @@ static void cps_boot_secondary(int cpu, struct task_struct *idle)
|
|||
mips_cm_unlock_other();
|
||||
}
|
||||
|
||||
if (core != cpu_core(¤t_cpu_data)) {
|
||||
if (!cpus_are_siblings(cpu, smp_processor_id())) {
|
||||
/* Boot a VPE on another powered up core */
|
||||
for (remote = 0; remote < NR_CPUS; remote++) {
|
||||
if (cpu_core(&cpu_data[remote]) != core)
|
||||
if (!cpus_are_siblings(cpu, remote))
|
||||
continue;
|
||||
if (cpu_online(remote))
|
||||
break;
|
||||
|
@ -431,7 +431,7 @@ void play_dead(void)
|
|||
|
||||
/* Look for another online VPE within the core */
|
||||
for_each_online_cpu(cpu_death_sibling) {
|
||||
if (cpu_core(&cpu_data[cpu_death_sibling]) != core)
|
||||
if (!cpus_are_siblings(cpu, cpu_death_sibling))
|
||||
continue;
|
||||
|
||||
/*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue