All of lore.kernel.org
 help / color / mirror / Atom feed
From: Yao Zi <me@ziyao.cc>
To: Nikita Shubin <nikita.shubin@maquefel.me>,
	Michal Simek <michal.simek@amd.com>, Yao Zi <me@ziyao.cc>,
	u-boot@lists.u-boot-project.org
Cc: Tim Ouyang <tim609@andestech.com>,
	Leo Liang <leo.liang@sifive.com>, Tom Rini <trini@konsulko.com>
Subject: Re: [PATCH] riscv: Fix IPI not initialized in riscv_cpu_setup()
Date: Fri, 25 Sep 2026 11:38:03 +0000	[thread overview]
Message-ID: <arZdGzVgm9ZtnSm_@pie> (raw)
In-Reply-To: <856f099441f717605de9be5456dde8c97bbd04d1.camel@maquefel.me>

On Fri, Sep 25, 2026 at 01:19:15PM +0300, Nikita Shubin wrote:
> Hi Yao Zi!
> 
> A shy ping on this patch.
> 
> Thanks !

Sorry for the delay.

> On Fri, 2026-09-04 at 08:20 +0200, Michal Simek wrote:
> > 
> > 
> > On 9/4/26 08:07, Nikita Shubin wrote:
> > > If riscv_cpu_setup() is skipped we end up with riscv_init_ipi() not
> > > being called.
> > > 
> > > But we still use riscv_send_ipi() in spl_invoke_opensbi(), so even
> > > if
> > > CONFIG_PHASE_CPU not set we still need init IPI and clear pending
> > > IPIs
> > > on harts.
> > > 
> > > Fixes: d8810e1d4f82 ("riscv: Skip riscv_cpu_setup() when CPU driver
> > > is disabled")
> > > Signed-off-by: Nikita Shubin <nikita.shubin@maquefel.me>
> > > ---
> > >   arch/riscv/cpu/cpu.c | 3 ++-
> > >   1 file changed, 2 insertions(+), 1 deletion(-)
> > > 
> > > diff --git a/arch/riscv/cpu/cpu.c b/arch/riscv/cpu/cpu.c
> > > index 3bec7c7cb6d..a65e6951384 100644
> > > --- a/arch/riscv/cpu/cpu.c
> > > +++ b/arch/riscv/cpu/cpu.c
> > > @@ -639,7 +639,7 @@ int riscv_cpu_setup(void)
> > >   	struct udevice *dev;
> > >   
> > >   	if (!CONFIG_IS_ENABLED(CPU))
> > > -		return 0;
> > > +		goto init_riscv_ipi;
> > >   
> > >   	uclass_find_first_device(UCLASS_CPU, &dev);
> > >   	if (!dev) {
> > > @@ -687,6 +687,7 @@ int riscv_cpu_setup(void)
> > >   #endif
> > >   	}
> > >   
> > > +init_riscv_ipi:
> > >   #if CONFIG_IS_ENABLED(SMP)
> > >   	ret = riscv_init_ipi();
> > >   	if (ret)
> > > 
> > > ---
> > > base-commit: cc557af4553382f6f50e3ed62b9577054e7bc54f
> > > change-id: 20260904-fix_skipped_ipi_init-aa5575f55bc4
> > > 
> > > Best regards,
> > 
> > There are 2 other approaches how to do it in the code but it is up to
> > maintainer 
> > to decide. No issue from my side to solve it via goto. Obviously one
> > big if 
> > (CONFIG_IS_ENABLED(CPU)) is another one. Or move it to own function.
> > 
> > Anyway
> > Acked-by: Michal Simek <michal.simek@amd.com>

I think it's likely a bad idea to have IPI stuff in riscv_cpu_setup(),
but this fix itself is okay. I should have noticed it when reviewing.

Reviewed-by: Yao Zi <me@ziyao.cc>

However, I'm RISC-V's reviewer instead of maintainer, so I couldn't pick
the patch for you though.

> > Thanks,
> > Michal

Best regards,
Yao Zi

  reply	other threads:[~2026-09-25 11:38 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-04  6:07 [PATCH] riscv: Fix IPI not initialized in riscv_cpu_setup() Nikita Shubin
2026-09-04  6:20 ` Michal Simek
2026-09-25 10:19   ` Nikita Shubin
2026-09-25 11:38     ` Yao Zi [this message]
2026-09-29  4:58       ` Nikita Shubin
2026-09-29 18:12         ` Leo Liang

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=arZdGzVgm9ZtnSm_@pie \
    --to=me@ziyao.cc \
    --cc=leo.liang@sifive.com \
    --cc=michal.simek@amd.com \
    --cc=nikita.shubin@maquefel.me \
    --cc=tim609@andestech.com \
    --cc=trini@konsulko.com \
    --cc=u-boot@lists.u-boot-project.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.