[Skiboot] [PATCH V6 10/12] opal/errorlog : Enables error log write to host on BMC systems

Mukesh Ojha mukesh02 at linux.vnet.ibm.com
Thu Sep 1 05:39:14 AEST 2016


Adds the support of error log write to host on BMC based system by using
the generic interface of error log read/write framework.

OPAL sents the error log messages to both BMC and PowerNV host by passing
the error log buffer.

Signed-off-by: Mukesh Ojha <mukesh02 at linux.vnet.ibm.com>
---
Changes in V6:
 - Rebased on master.

Changes in V5:
 - Separated the removal of elog_init() routine to a different
   patch(V5 9/10).

Changes in V4:
 - Changes are rebased on master.

Changes in V3:
 - Moves the unrelated changes to 2/3 as per review comment.

 hw/ipmi/ipmi-sel.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/hw/ipmi/ipmi-sel.c b/hw/ipmi/ipmi-sel.c
index 369cebc..4bf703e 100644
--- a/hw/ipmi/ipmi-sel.c
+++ b/hw/ipmi/ipmi-sel.c
@@ -417,12 +417,22 @@ 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 error log 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;
 	}
 
@@ -434,6 +444,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;
 	}
 
@@ -444,6 +455,7 @@ int ipmi_elog_commit(struct errorlog *elog_buf)
 	else
 		ipmi_queue_msg(msg);
 
+	elog_append_write_to_host(elog_buf);
 	return 0;
 }
 
-- 
2.7.4



More information about the Skiboot mailing list