[PATCH] riscv: Add WFI to secondary hart spinwait loop

Nam Cao namcao at linutronix.de
Tue Apr 7 04:48:41 PDT 2026


litaliano00 <litaliano00.contact at gmail.com> writes:
> You are correct to question this. There is no interrupt sent to the
> waiting harts in the current spinwait design — the primary hart simply
> writes to __cpu_spinwait_stack_pointer and __cpu_spinwait_task_pointer.
> A bare WFI would cause secondary harts to sleep indefinitely since no
> IPI is issued after those writes.
>
> The correct fix would require the primary hart to send an IPI to all
> waiting harts after populating the pointers, which is a more involved
> change. The current patch is insufficient as-is.

Yeah, that's also what I would do.

> I will send a v2 that reverts this change. Apologies for the noise.

There's no need for that, this patch has not been applied.

Best regards,
Nam



More information about the linux-riscv mailing list