aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVasant Hegde <hegdevasant@linux.vnet.ibm.com>2020-03-04 14:28:06 +0530
committerVasant Hegde <hegdevasant@linux.vnet.ibm.com>2020-03-20 10:53:46 +0530
commit4d207b1bc18c513c72b9427a7ab9a9e94a0a6e99 (patch)
treef9b4ecef0e0e8270b2336f080c58210a8a426204
parent6547d51381b518d46fc6b22b40e5502eb6bece5b (diff)
downloadskiboot-4d207b1bc18c513c72b9427a7ab9a9e94a0a6e99.zip
skiboot-4d207b1bc18c513c72b9427a7ab9a9e94a0a6e99.tar.gz
skiboot-4d207b1bc18c513c72b9427a7ab9a9e94a0a6e99.tar.bz2
eSEL: Make sure PANIC logs are sent to BMC before calling assert
[ Upstream commit 033e797cb0d77b151ab6e47d8fb7666a09641107 ] eSEL logs are split into multiple smaller chunks and sent to BMC. We use ipmi_queue_msg_sync() interface for sending OPAL_ERROR_PANIC severity events to BMC. But callback handler (ipmi_cmd_done()) clears 'sync_msg' after getting response to first chunk as its not aware that we have more data to send. So in assert()/checkstop path we may endup checkstoping system before error log is sent to BMC completely. We will miss useful error log. This patch introduces new wait loop in ipmi_elog_commit(). It will wait until error log is sent to BMC. I think this is safe because even if something goes wrong (like BMC reset) we will hit timeout and eventually we will come out of this loop. Alternatively we can add additional check in ipmi_cmd_done() path. But I don't wanted to make this path aware of message type. Reviewed-by: Klaus Heinrich Kiwi <klaus@linux.vnet.ibm.com> Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Signed-off-by: Oliver O'Halloran <oohall@gmail.com> Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
-rw-r--r--hw/ipmi/ipmi-sel.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/hw/ipmi/ipmi-sel.c b/hw/ipmi/ipmi-sel.c
index 794aa38..87d3581 100644
--- a/hw/ipmi/ipmi-sel.c
+++ b/hw/ipmi/ipmi-sel.c
@@ -18,6 +18,7 @@
#include <opal-msg.h>
#include <debug_descriptor.h>
#include <occ.h>
+#include <timebase.h>
/* OEM SEL fields */
#define SEL_OEM_ID_0 0x55
@@ -433,10 +434,22 @@ int ipmi_elog_commit(struct errorlog *elog_buf)
msg->error = ipmi_elog_error;
msg->req_size = 0;
- if (elog_buf->event_severity == OPAL_ERROR_PANIC)
+ if (elog_buf->event_severity == OPAL_ERROR_PANIC) {
ipmi_queue_msg_sync(msg);
- else
+
+ /*
+ * eSEL logs are split into multiple smaller chunks and sent
+ * to BMC. Lets wait until we finish sending all the chunks
+ * to BMC.
+ */
+ while (ipmi_sel_panic_msg.busy != false) {
+ if (msg->backend->poll)
+ msg->backend->poll();
+ time_wait_ms(10);
+ }
+ } else {
ipmi_queue_msg(msg);
+ }
return 0;
}