diff options
| author | Samuel Holland <[email protected]> | 2023-12-18 18:13:45 +0530 |
|---|---|---|
| committer | Anup Patel <[email protected]> | 2023-12-18 19:26:11 +0530 |
| commit | a894187e28895ab8e1196dea838fdef4cc4d32b3 (patch) | |
| tree | 1c31096814909402b70a03a7c83cb05b8987d401 | |
| parent | 35cba9265514ab73cc3f1777f8ee179f6aa71cd5 (diff) | |
lib: sbi_ipi: Do not ignore errors from sbi_ipi_send()
Currently, failures in sbi_ipi_send() are silently ignored, which makes
them difficult to debug. Instead, abort sending the IPI and pass back
the error, but still synchronize any IPIs already sent.
Signed-off-by: Samuel Holland <[email protected]>
Signed-off-by: Anup Patel <[email protected]>
| -rw-r--r-- | lib/sbi/sbi_ipi.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/sbi/sbi_ipi.c b/lib/sbi/sbi_ipi.c index 5c33a78b..56ba743c 100644 --- a/lib/sbi/sbi_ipi.c +++ b/lib/sbi/sbi_ipi.c @@ -101,7 +101,7 @@ static int sbi_ipi_sync(struct sbi_scratch *scratch, u32 event) */ int sbi_ipi_send_many(ulong hmask, ulong hbase, u32 event, void *data) { - int rc; + int rc = 0; bool retry_needed; ulong i, m; struct sbi_hartmask target_mask = {0}; @@ -135,17 +135,21 @@ int sbi_ipi_send_many(ulong hmask, ulong hbase, u32 event, void *data) retry_needed = false; sbi_hartmask_for_each_hartindex(i, &target_mask) { rc = sbi_ipi_send(scratch, i, event, data); + if (rc < 0) + goto done; if (rc == SBI_IPI_UPDATE_RETRY) retry_needed = true; else sbi_hartmask_clear_hartindex(i, &target_mask); + rc = 0; } } while (retry_needed); +done: /* Sync IPIs */ sbi_ipi_sync(scratch, event); - return 0; + return rc; } int sbi_ipi_event_create(const struct sbi_ipi_event_ops *ops) |
