[Skiboot] [PATCH V3 6/6] opal/errorlog : Enables errorlog write to host on BMC systems
Mukesh Ojha
mukesh02 at linux.vnet.ibm.com
Mon Jun 13 06:50:00 AEST 2016
Adds the support of errorlog write to host on BMC based system by using the
generic interface of errorlog read/write framework. OPAL sents the errorlog
messages to both BMC and host kernel by passing the errorlog buffers.
'opal_elog_init' initialises the memory and the callbacks require for
errorlog write to host framework.
Signed-off-by: Mukesh Ojha <mukesh02 at linux.vnet.ibm.com>
---
Changes in V3:
- Moves the unrelated changes to 2/3 as per review comment.
Changes in V2:
- Changes description.
- get_elog, put_elog routine and ref_count variable implementation move to
the separate patch 5/6
hw/ipmi/ipmi-sel.c | 11 +++++++++++
platforms/astbmc/common.c | 6 ++++--
2 files changed, 15 insertions(+), 2 deletions(-)
diff --git a/hw/ipmi/ipmi-sel.c b/hw/ipmi/ipmi-sel.c
index 451e25d..ed1e20b 100644
--- a/hw/ipmi/ipmi-sel.c
+++ b/hw/ipmi/ipmi-sel.c
@@ -415,11 +415,20 @@ int ipmi_elog_commit(struct errorlog *elog_buf)
{
struct ipmi_msg *msg;
+ get_elog(elog_buf);
+ /* We take get_elog two times to make sure errorlog will be sent to
+ * both BMC and the host irrespective of either of them is complete
+ * or not, buffer will be return to the pool during the call of
+ * opal_elog_complete.
+ */
+ get_elog(elog_buf);
+
/* Only log events that needs attention */
if (elog_buf->event_severity < OPAL_PREDICTIVE_ERR_FAULT_RECTIFY_REBOOT ||
elog_buf->elog_origin != ORG_SAPPHIRE) {
prlog(PR_INFO, "dropping non severe PEL event\n");
opal_elog_complete(elog_buf, true);
+ elog_append_write_to_host(elog_buf);
return 0;
}
@@ -430,6 +439,7 @@ int ipmi_elog_commit(struct errorlog *elog_buf)
msg = ipmi_sel_alloc_msg(elog_buf);
if (!msg) {
opal_elog_complete(elog_buf, false);
+ elog_append_write_to_host(elog_buf);
return OPAL_RESOURCE;
}
@@ -440,6 +450,7 @@ int ipmi_elog_commit(struct errorlog *elog_buf)
else
ipmi_queue_msg(msg);
+ elog_append_write_to_host(elog_buf);
return 0;
}
diff --git a/platforms/astbmc/common.c b/platforms/astbmc/common.c
index 1ed7d42..2a0dd48 100644
--- a/platforms/astbmc/common.c
+++ b/platforms/astbmc/common.c
@@ -115,8 +115,10 @@ void astbmc_init(void)
/* Register the BT interface with the IPMI layer */
bt_init();
- /* Initialize elog */
- elog_init();
+
+ /* Initialize the errorlog framework */
+ opal_elog_init();
+
ipmi_sel_init();
ipmi_wdt_init();
ipmi_rtc_init();
--
2.1.4
More information about the Skiboot
mailing list