lkml.org 
[lkml]   [2021]   [Feb]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH v2] mips: smp-bmips: fix CPU mappings
Date
Hi all,

Apparently, this patch was flagged as "Not Applicable" without an explanation. Why?
https://patchwork.kernel.org/project/linux-mips/patch/20210224073336.32265-1-noltari@gmail.com/

Best regarss,
Álvaro.

> El 24 feb 2021, a las 8:33, Álvaro Fernández Rojas <noltari@gmail.com> escribió:
>
> 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>
> ---
> v2: Fix duplicated line
>
> arch/mips/kernel/smp-bmips.c | 27 +++++++++++++++++----------
> 1 file changed, 17 insertions(+), 10 deletions(-)
>
> diff --git a/arch/mips/kernel/smp-bmips.c b/arch/mips/kernel/smp-bmips.c
> index 359b176b665f..b6ef5f7312cf 100644
> --- 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;
> -
> - for (i = 0; i < max_cpus; i++) {
> - if (i != boot_cpu) {
> - __cpu_number_map[i] = cpu;
> - __cpu_logical_map[cpu] = i;
> - 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++;
> + }
> + 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);
> }
> }
>
> --
> 2.20.1
>

\
 
 \ /
  Last update: 2021-02-27 07:49    [W:0.102 / U:0.084 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site