[Skiboot] [PATCH 8/9] ipmi: return error from ipmi_queue_msg_sync
Nicholas Piggin
npiggin at gmail.com
Mon Mar 31 23:46:34 AEDT 2025
Signed-off-by: Nicholas Piggin <npiggin at gmail.com>
---
core/ipmi.c | 8 +++++---
include/ipmi.h | 2 +-
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 2b1bb1ca3..acb97d4c5 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 ff97a4174..aa41238ce 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 b740a6f2b..b927182f5 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)),
--
2.47.1
More information about the Skiboot
mailing list