@@ -170,15 +170,17 @@ void log_commit(struct errorlog *elog)
/* Increments the number of users using error log buffer */
get_elog(elog);
+ /*
+ * If platform doesn't provide elog commit hook, then call generic
+ * commit interface to send ELOG to host OS.
+ */
if (platform.elog_commit) {
rc = platform.elog_commit(elog);
if (rc)
prerror("ELOG: Platform commit error %d\n", rc);
-
- return;
+ } else {
+ elog_append_write_to_host(elog);
}
-
- opal_elog_complete(elog, false);
}
void log_append_data(struct errorlog *buf, unsigned char *data, uint16_t size)
@@ -29,6 +29,7 @@
#include <io.h>
#include <cec.h>
#include <device.h>
+#include <errorlog.h>
#include <pci.h>
#include <lpc.h>
#include <i2c.h>
@@ -875,6 +876,9 @@ void __noreturn __nomcount main_cpu_entry(const void *fdt)
/* Register routine to dispatch and read sensors */
sensor_init();
+ /* Initialize the error log framework */
+ opal_elog_init();
+
/*
* Initialize the opal messaging before platform.init as we are
* getting request to queue occ load opal message when host services
@@ -121,9 +121,6 @@ void astbmc_init(void)
/* Register the BT interface with the IPMI layer */
bt_init();
- /* Initialize error log */
- opal_elog_init();
-
ipmi_sel_init();
ipmi_wdt_init();
ipmi_rtc_init();
@@ -93,9 +93,6 @@ void ibm_fsp_init(void)
/* Get ready to receive OCC related messages */
occ_fsp_init();
- /* Initialize the error log framework */
- opal_elog_init();
-
/* Get ready to receive Memory [Un]corretable Error messages. */
fsp_memory_err_init();
@@ -92,8 +92,6 @@ static void qemu_init(void)
/* Register the BT interface with the IPMI layer */
bt_init();
- /* Initialize error log */
- opal_elog_init();
ipmi_sel_init();
ipmi_wdt_init();
ipmi_opal_init();