[PATCH 1/1] riscv: don't jump to 0x0 in handle_ipi()

Heinrich Schuchardt xypron.glpk at gmx.de
Tue Aug 11 05:56:48 CEST 2020


At least on the Kendryte K210:

gd->arch.available_harts= 0x0000000000000003
gd->arch.ipi[0].addr= 0x0000000000000000
gd->arch.ipi[0].arg0= 0x0000000000000000
gd->arch.ipi[0].arg1= 0x0000000000000000
gd->arch.ipi[1].addr= 0x0000000000000000
gd->arch.ipi[1].arg0= 0x0000000000000000
gd->arch.ipi[1].arg1= 0x0000000000000000

We should not jump to 0x0 to handle an interrupt.

Signed-off-by: Heinrich Schuchardt <xypron.glpk at gmx.de>
---
 arch/riscv/lib/smp.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/riscv/lib/smp.c b/arch/riscv/lib/smp.c
index ac22136314..d725fa32e8 100644
--- a/arch/riscv/lib/smp.c
+++ b/arch/riscv/lib/smp.c
@@ -96,6 +96,8 @@ void handle_ipi(ulong hart)
 		return;
 	}

+	if (!smp_function)
+		return;
 	smp_function(hart, gd->arch.ipi[hart].arg0, gd->arch.ipi[hart].arg1);
 }

--
2.28.0



More information about the U-Boot mailing list