[PATCH v2] riscv: Move call to init_cpu_topology() to later initialization stage

Geert Uytterhoeven geert at linux-m68k.org
Wed Jan 25 07:29:19 PST 2023


Hi Ley,

On Thu, Jan 5, 2023 at 4:45 AM Ley Foon Tan
<leyfoon.tan at starfivetech.com> wrote:
> If "capacity-dmips-mhz" is present in a CPU DT node,
> topology_parse_cpu_capacity() will fail to allocate memory.
> ARM64, with which this code path is shared, does not call
> topology_parse_cpu_capacity() until later in boot where memory allocation
> is available.
>
> Move init_cpu_topology(), which calls topology_parse_cpu_capacity(), to a
> later initialization stage, to match ARM64.
>
> Tested on Qemu platform.
>
> Fixes: 03f11f03dbfe ("RISC-V: Parse cpu topology during boot.")
> Reviewed-by: Conor Dooley <conor.dooley at microchip.com>
> Reviewed-by: Andrew Jones <ajones at ventanamicro.com>
> Signed-off-by: Ley Foon Tan <leyfoon.tan at starfivetech.com>
>
> ---
> Changes:
> v2:
> - Update commit description with suggestion from Conor.
> - Added Reviewed-by.
> - Added Fixes.

This also fixes the error message

    Early cacheinfo failed, ret = -12

seen during early boot on all my RV64 platforms.

Fixes: 5944ce092b97caed ("arch_topology: Build cacheinfo from primary CPU")
Tested-by: Geert Uytterhoeven <geert+renesas at glider.be>

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert at linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds



More information about the linux-riscv mailing list