Skip to content

Commit

Permalink
riscv/cpustart: Ensure we receive Soft IRQ / IPI before booting CPU
Browse files Browse the repository at this point in the history
Some spurious interrupt might wake WFI, ensure we got woken by IPI before
continuing CPU boot.
  • Loading branch information
pussuw authored and xiaoxiang781216 committed Oct 16, 2024
1 parent eb27ebb commit 526ba1a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion arch/risc-v/src/common/riscv_cpustart.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,11 @@ void riscv_cpu_boot(int cpu)

/* Wait interrupt */

asm("WFI");
do
{
asm("WFI");
}
while (READ_CSR(CSR_IP) != IP_SIP);

#ifdef CONFIG_RISCV_PERCPU_SCRATCH
/* Initialize the per CPU areas */
Expand Down

0 comments on commit 526ba1a

Please sign in to comment.