diff options
author | Nicholas Piggin <npiggin@gmail.com> | 2025-03-31 22:46:34 +1000 |
---|---|---|
committer | Reza Arbab <arbab@linux.ibm.com> | 2025-04-18 09:42:50 -0500 |
commit | 98eaa954dbc3836dede8db5a6a0cfeacadb4df57 (patch) | |
tree | 4c5523e271eb426ff6d21cc5db1c9f93f25a3b7e | |
parent | 1ee6e33c27bae4080eb3c53e8ded9ed8e3c2b15f (diff) | |
download | skiboot-98eaa954dbc3836dede8db5a6a0cfeacadb4df57.zip skiboot-98eaa954dbc3836dede8db5a6a0cfeacadb4df57.tar.gz skiboot-98eaa954dbc3836dede8db5a6a0cfeacadb4df57.tar.bz2 |
ipmi: Return error from ipmi_queue_msg_sync
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Reza Arbab <arbab@linux.ibm.com>
-rw-r--r-- | core/ipmi.c | 8 | ||||
-rw-r--r-- | include/ipmi.h | 2 | ||||
-rw-r--r-- | libflash/test/test-ipmi-hiomap.c | 4 |
3 files changed, 9 insertions, 5 deletions
diff --git a/core/ipmi.c b/core/ipmi.c index 2b1bb1c..acb97d4 100644 --- a/core/ipmi.c +++ b/core/ipmi.c @@ -157,16 +157,16 @@ void ipmi_cmd_done(uint8_t cmd, uint8_t netfn, uint8_t cc, struct ipmi_msg *msg) } } -void ipmi_queue_msg_sync(struct ipmi_msg *msg) +int ipmi_queue_msg_sync(struct ipmi_msg *msg) { bool (*poll)(void) = msg->backend->poll; if (!ipmi_present()) - return; + return OPAL_HARDWARE; if (!msg) { prerror("%s: Attempting to queue NULL message\n", __func__); - return; + return OPAL_PARAMETER; } lock(&sync_lock); @@ -190,6 +190,8 @@ void ipmi_queue_msg_sync(struct ipmi_msg *msg) poll(); time_wait_ms(10); } + + return OPAL_SUCCESS; } void ipmi_flush(void) diff --git a/include/ipmi.h b/include/ipmi.h index ff97a41..aa41238 100644 --- a/include/ipmi.h +++ b/include/ipmi.h @@ -218,7 +218,7 @@ int ipmi_queue_msg_head(struct ipmi_msg *msg); /* Synchronously send an ipmi message. This won't return until the * messages callback has been called. */ -void ipmi_queue_msg_sync(struct ipmi_msg *msg); +int ipmi_queue_msg_sync(struct ipmi_msg *msg); /* Removes the message from the list, queued previously */ int ipmi_dequeue_msg(struct ipmi_msg *msg); diff --git a/libflash/test/test-ipmi-hiomap.c b/libflash/test/test-ipmi-hiomap.c index b740a6f..b927182 100644 --- a/libflash/test/test-ipmi-hiomap.c +++ b/libflash/test/test-ipmi-hiomap.c @@ -148,7 +148,7 @@ void ipmi_free_msg(struct ipmi_msg *msg __attribute__((unused))) free(msg->data); } -void ipmi_queue_msg_sync(struct ipmi_msg *msg) +int ipmi_queue_msg_sync(struct ipmi_msg *msg) { struct ipmi_msg_ctx *ctx = container_of(msg, struct ipmi_msg_ctx, msg); const struct scenario_cmd *cmd; @@ -193,6 +193,8 @@ void ipmi_queue_msg_sync(struct ipmi_msg *msg) ctx->sel.fn(ctx->cursor->s.bmc_state, ctx->sel.context); ctx->cursor++; } + + return OPAL_SUCCESS; } int ipmi_sel_register(uint8_t oem_cmd __attribute__((unused)), |