From: Conor Dooley <conor.dooley@microchip.com>
To: Song Shuai <suagrfillet@gmail.com>
Cc: <paul.walmsley@sifive.com>, <palmer@dabbelt.com>,
<aou@eecs.berkeley.edu>, <ajones@ventanamicro.com>,
<sunilvl@ventanamicro.com>, <heiko.stuebner@vrull.eu>,
<apatel@ventanamicro.com>, <evan@rivosinc.com>,
<greentime.hu@sifive.com>, <leyfoon.tan@starfivetech.com>,
<linux-riscv@lists.infradead.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] riscv: BUG_ON() for no cpu nodes in setup_smp
Date: Thu, 29 Jun 2023 13:33:48 +0100 [thread overview]
Message-ID: <20230629-maverick-kelp-17327f04482a@wendy> (raw)
In-Reply-To: <20230629105839.1160895-1-suagrfillet@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 2182 bytes --]
Hey,
On Thu, Jun 29, 2023 at 06:58:39PM +0800, Song Shuai wrote:
> When booting with ACPI tables, the tiny devictree created by
> EFI Stub doesn't provide cpu nodes.
What are the conditions that are required to reproduce this issue?
When booting with ACPI, why is acpi_disabled true?
In my naivety, that seems like a bigger problem to address..
> In setup_smp(), of_parse_and_init_cpus() will bug on !found_boot_cpu
Please, s/on !found_boot_cpu/if the boot cpu is not found in the
devicetree/, or similar.
> if acpi_disabled.
Why would of_parse_and_init_cpus() be called in any other case? There's
only this one caller, right?
> That's unclear, so bug for no cpu nodes before
> of_parse_and_init_cpus().
What is unclear? That the reason for the BUG() was that there were no
cpu nodes, since it could also be that there were CPU nodes but they
were disabled etc?
> Signed-off-by: Song Shuai <suagrfillet@gmail.com>
> ---
> arch/riscv/kernel/smpboot.c | 7 ++++++-
> 1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/arch/riscv/kernel/smpboot.c b/arch/riscv/kernel/smpboot.c
> index 6ca2b5309aab..243a7b533ad7 100644
> --- a/arch/riscv/kernel/smpboot.c
> +++ b/arch/riscv/kernel/smpboot.c
> @@ -187,8 +187,13 @@ static void __init of_parse_and_init_cpus(void)
>
> void __init setup_smp(void)
> {
> - if (acpi_disabled)
> + if (acpi_disabled) {
> + /* When booting with ACPI tables, the devictree created by EFI Stub
This is not netdev, please use the correct comment style :/
> + * doesn't provide cpu nodes. So BUG here for any acpi_disabled.
> + */
> + BUG_ON(!of_get_next_cpu_node(NULL));
> of_parse_and_init_cpus();
> + }
> else
> acpi_parse_and_init_cpus();
checkpatch should have told you that you now need to add braces on all
arms of this statement.
Or, better yet, move the whole thing into of_parse_and_init_cpus() in
the first place? You could drop most of the comment in the process,
since I think the details of how you hit this problem would likely not
be helpful to anyone that hit it under different conditions.
Cheers,
Conor.
> }
> --
> 2.20.1
>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
next prev parent reply other threads:[~2023-06-29 12:35 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-29 10:58 Song Shuai
2023-06-29 12:33 ` Conor Dooley [this message]
2023-06-30 3:02 ` Song Shuai
2023-06-30 6:33 ` Conor Dooley
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230629-maverick-kelp-17327f04482a@wendy \
--to=conor.dooley@microchip.com \
--cc=ajones@ventanamicro.com \
--cc=aou@eecs.berkeley.edu \
--cc=apatel@ventanamicro.com \
--cc=evan@rivosinc.com \
--cc=greentime.hu@sifive.com \
--cc=heiko.stuebner@vrull.eu \
--cc=leyfoon.tan@starfivetech.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=palmer@dabbelt.com \
--cc=paul.walmsley@sifive.com \
--cc=suagrfillet@gmail.com \
--cc=sunilvl@ventanamicro.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®