summaryrefslogtreecommitdiff
path: root/include/sbi
diff options
context:
space:
mode:
authorBen Dooks <ben.dooks@sifive.com>2022-07-11 10:18:03 +0300
committerAnup Patel <anup@brainfault.org>2022-07-11 13:16:59 +0300
commitcaa5eeacacbc935090968e601716f66a6195ceef (patch)
tree8485b24961388fc16885ae81c409b828d854c70e /include/sbi
parent994c8cfb29d0b53bbcc774a728cad778aeece6ac (diff)
downloadopensbi-caa5eeacacbc935090968e601716f66a6195ceef.tar.xz
lib: sbi: add check for ipi device for hsm start
If the ecall SBI_EXT_HSM_HART_START is called it might try to wake the secondary hart using sbi_ipi_raw_send() to send an IPI to the hart. This can fail if there is no IPI device but no error is returned from sbi_ipi_raw_send() so the ecall returns as if the action completed and the caller continues without noticing (in the case of Linux it just hangs waiting for the secondary hart to become active) Fix this by changing sbi_ipi_raw_send() to return and error, and if an error is returned, then return it via SBI_EXT_HSM_HART_START call. Signed-off-by: Ben Dooks <ben.dooks@sifive.com> Reviewed-by: Anup Patel <anup@brainfault.org>
Diffstat (limited to 'include/sbi')
-rw-r--r--include/sbi/sbi_ipi.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/sbi/sbi_ipi.h b/include/sbi/sbi_ipi.h
index fb7d658..f6ac807 100644
--- a/include/sbi/sbi_ipi.h
+++ b/include/sbi/sbi_ipi.h
@@ -75,7 +75,7 @@ int sbi_ipi_send_halt(ulong hmask, ulong hbase);
void sbi_ipi_process(void);
-void sbi_ipi_raw_send(u32 target_hart);
+int sbi_ipi_raw_send(u32 target_hart);
const struct sbi_ipi_device *sbi_ipi_get_device(void);