mirror of
https://github.com/brain-hackers/u-boot-brain
synced 2024-09-30 16:40:44 +09:00
riscv: Match memory barriers between send_ipi_many and handle_ipi
Without a matching barrier on the write side, the barrier in handle_ipi
does nothing. It was entirely possible for the boot hart to write to addr,
arg0, and arg1 *after* sending the IPI, because there was no barrier on the
sending side.
Fixes: 90ae281437
("riscv: add option to wait for ack from secondary harts in smp functions")
Signed-off-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Bin Meng <bin.meng@windriver.com>
Reviewed-by: Rick Chen <rick@andestech.com>
Reviewed-by: Leo Liang <ycliang@andestech.com>
This commit is contained in:
parent
c41045411b
commit
d4990a4648
@ -54,6 +54,8 @@ static int send_ipi_many(struct ipi_data *ipi, int wait)
|
||||
gd->arch.ipi[reg].arg0 = ipi->arg0;
|
||||
gd->arch.ipi[reg].arg1 = ipi->arg1;
|
||||
|
||||
__smp_mb();
|
||||
|
||||
ret = riscv_send_ipi(reg);
|
||||
if (ret) {
|
||||
pr_err("Cannot send IPI to hart %d\n", reg);
|
||||
|
Loading…
Reference in New Issue
Block a user