[Skiboot] [PATCH V8 8/9] errorlog: Enable error log write to host on BMC systems

Mukesh Ojha mukesh02 at linux.vnet.ibm.com
Tue Nov 15 21:10:44 AEDT 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 sends 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>
Reviewed-by: Vasant Hegde <hegdevasant at linux.vnet.ibm.com>
---
Changes in V8:
 - Previous version V7 1/12 to 3/12 is already in the master.
 - Rebased on master.

Changes in V7:
 - This patch sequence changed from V6 10/12 to V7's 11/12.
 - Comment changed.
 - Extra get_elog() removed.
 - Subject tag changed from opal/errorlog to errorlog.

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 | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/hw/ipmi/ipmi-sel.c b/hw/ipmi/ipmi-sel.c
index 2cd4535..ce425ff 100644
--- a/hw/ipmi/ipmi-sel.c
+++ b/hw/ipmi/ipmi-sel.c
@@ -423,12 +423,23 @@ int ipmi_elog_commit(struct errorlog *elog_buf)
 {
 	struct ipmi_msg *msg;
 
+	/*
+	 * We take 'get_elog()' one more time to make sure error log will
+	 * be sent to both BMC and the host, irrespective of either of them
+	 * is complete or not.
+	 * Reference count will be decremented on a call to
+	 * 'opal_elog_complete()' and buffer object gets free on zero
+	 * reference count.
+	 */
+	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;
 	}
 
@@ -440,6 +451,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;
 	}
 
@@ -450,6 +462,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