[Skiboot] [PATCH V2 6/6] opal/errorlog : Enables errorlog write to host on BMC systems

Mukesh Ojha mukesh02 at linux.vnet.ibm.com
Thu Jun 9 23:54:10 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 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        | 16 ++++++++++++++--
 platforms/astbmc/common.c |  6 ++++--
 2 files changed, 18 insertions(+), 4 deletions(-)

diff --git a/hw/ipmi/ipmi-sel.c b/hw/ipmi/ipmi-sel.c
index 6bc386a..3e6091c 100644
--- a/hw/ipmi/ipmi-sel.c
+++ b/hw/ipmi/ipmi-sel.c
@@ -415,24 +415,35 @@ 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;
 	}
 
 	/* We pass a large request size in to mkmsg so that we have a
 	 * large enough allocation to reuse the message to pass the
-	 * PEL data via a series of partial add commands.  */
+	 * PEL data via a series of partial add commands.
+	 */
 	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;
 	}
-	msg->error = ipmi_elog_error;
 
+	msg->error = ipmi_elog_error;
 	msg->req_size = 0;
 
 	if (elog_buf->event_severity == OPAL_ERROR_PANIC)
@@ -440,6 +451,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