diff options
author | Álvaro Fernández Rojas <noltari@gmail.com> | 2021-03-14 14:21:48 +0100 |
---|---|---|
committer | Álvaro Fernández Rojas <noltari@gmail.com> | 2021-03-14 16:21:27 +0100 |
commit | 4a81b00a0510d30f1f1e29a76cb0d5fbbe49091c (patch) | |
tree | 175c81db3e56dc72ad34ccea408d2154334f7d35 /target/linux/bmips/patches-5.10/040-v5.13-mips-smp-bmips-fix-CPU-mappings.patch | |
parent | e6ba970b6ef2289a2a4d3dd6c0c158ee8d10160f (diff) | |
download | upstream-4a81b00a0510d30f1f1e29a76cb0d5fbbe49091c.tar.gz upstream-4a81b00a0510d30f1f1e29a76cb0d5fbbe49091c.tar.bz2 upstream-4a81b00a0510d30f1f1e29a76cb0d5fbbe49091c.zip |
bmips: reorganize patches
Rename and reorganize backported patches.
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
Diffstat (limited to 'target/linux/bmips/patches-5.10/040-v5.13-mips-smp-bmips-fix-CPU-mappings.patch')
-rw-r--r-- | target/linux/bmips/patches-5.10/040-v5.13-mips-smp-bmips-fix-CPU-mappings.patch | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/target/linux/bmips/patches-5.10/040-v5.13-mips-smp-bmips-fix-CPU-mappings.patch b/target/linux/bmips/patches-5.10/040-v5.13-mips-smp-bmips-fix-CPU-mappings.patch new file mode 100644 index 0000000000..6ae4330439 --- /dev/null +++ b/target/linux/bmips/patches-5.10/040-v5.13-mips-smp-bmips-fix-CPU-mappings.patch @@ -0,0 +1,60 @@ +From c0f41a0dac1f3db6c40aabc0f3ac8868709ba6a6 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?=C3=81lvaro=20Fern=C3=A1ndez=20Rojas?= <noltari@gmail.com> +Date: Wed, 24 Feb 2021 08:33:36 +0100 +Subject: [PATCH] mips: smp-bmips: fix CPU mappings +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +When booting bmips with SMP enabled on a BCM6358 running on CPU #1 instead of +CPU #0, the current CPU mapping code produces the following: +- smp_processor_id(): 0 +- cpu_logical_map(0): 1 +- cpu_number_map(0): 1 + +This is because SMP isn't supported on BCM6358 since it has a shared TLB, so +it is disabled and max_cpus is decreased from 2 to 1. + +Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com> +Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> +Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de> +--- + arch/mips/kernel/smp-bmips.c | 27 +++++++++++++++++---------- + 1 file changed, 17 insertions(+), 10 deletions(-) + +--- a/arch/mips/kernel/smp-bmips.c ++++ b/arch/mips/kernel/smp-bmips.c +@@ -134,17 +134,24 @@ static void __init bmips_smp_setup(void) + if (!board_ebase_setup) + board_ebase_setup = &bmips_ebase_setup; + +- __cpu_number_map[boot_cpu] = 0; +- __cpu_logical_map[0] = boot_cpu; ++ if (max_cpus > 1) { ++ __cpu_number_map[boot_cpu] = 0; ++ __cpu_logical_map[0] = boot_cpu; + +- for (i = 0; i < max_cpus; i++) { +- if (i != boot_cpu) { +- __cpu_number_map[i] = cpu; +- __cpu_logical_map[cpu] = i; +- cpu++; ++ for (i = 0; i < max_cpus; i++) { ++ if (i != boot_cpu) { ++ __cpu_number_map[i] = cpu; ++ __cpu_logical_map[cpu] = i; ++ cpu++; ++ } ++ set_cpu_possible(i, 1); ++ set_cpu_present(i, 1); + } +- set_cpu_possible(i, 1); +- set_cpu_present(i, 1); ++ } else { ++ __cpu_number_map[0] = boot_cpu; ++ __cpu_logical_map[0] = 0; ++ set_cpu_possible(0, 1); ++ set_cpu_present(0, 1); + } + } + |