[Skiboot] [PATCH V8 7/9] errorlog: Remove the usage of 'elog_init()' routine, replaces it with 'opal_elog_init()' for BMC systems

Mukesh Ojha mukesh02 at linux.vnet.ibm.com
Tue Nov 15 21:10:43 AEDT 2016


Let us have a single routine 'opal_elog_init()' which initialises the
error log infrastructure. As part of the movement, better to move the
content of the 'elog_init()' to 'opal_elog_init()' and remove
'elog_init()' routine.

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 9/12 to V7's 10/11.
 - Subject tag changed from opal/errorlog to errorlog.

Changes in V6:
 - Rebased on master.

Changes in V5:
 - New patch.

 core/errorlog.c           | 18 ++++++------------
 include/errorlog.h        |  1 -
 platforms/astbmc/common.c |  6 ++++--
 3 files changed, 10 insertions(+), 15 deletions(-)

diff --git a/core/errorlog.c b/core/errorlog.c
index e778eae..a00cf0b 100644
--- a/core/errorlog.c
+++ b/core/errorlog.c
@@ -477,17 +477,6 @@ static bool opal_kexec_elog_notify(void *data __unused)
 	return true;
 }
 
-int elog_init(void)
-{
-	/* Pre-allocate memory for records */
-	if (pool_init(&elog_pool, sizeof(struct errorlog),
-					ELOG_WRITE_MAX_RECORD, 1))
-		return OPAL_RESOURCE;
-
-	elog_available = true;
-	return 0;
-}
-
 void opal_elog_init(void)
 {
 	elog_write_to_host_buffer = memalign(TCE_PSIZE,
@@ -503,5 +492,10 @@ void opal_elog_init(void)
 	opal_register(OPAL_ELOG_RESEND, opal_resend_pending_logs, 0);
 	opal_register(OPAL_ELOG_SIZE, opal_elog_info, 3);
 
-	elog_init();
+        /* Pre-allocate memory for records */
+        if (pool_init(&elog_pool, sizeof(struct errorlog),
+                                        ELOG_WRITE_MAX_RECORD, 1))
+                return;
+
+        elog_available = true;
 }
diff --git a/include/errorlog.h b/include/errorlog.h
index fa9d4a1..46a9aa7 100644
--- a/include/errorlog.h
+++ b/include/errorlog.h
@@ -375,7 +375,6 @@ void log_commit(struct errorlog *elog);
 void opal_elog_complete(struct errorlog *elog, bool success);
 void opal_elog_init(void);
 
-int elog_init(void);
 void elog_append_write_to_host(struct errorlog *buf);
 void elog_set_head_state(bool opal_logs, enum elog_head_state state);
 
diff --git a/platforms/astbmc/common.c b/platforms/astbmc/common.c
index 6e678a1..c25f6a6 100644
--- a/platforms/astbmc/common.c
+++ b/platforms/astbmc/common.c
@@ -120,8 +120,10 @@ void astbmc_init(void)
 
 	/* Register the BT interface with the IPMI layer */
 	bt_init();
-	/* Initialize elog */
-	elog_init();
+
+	/* Initialize error log */
+	opal_elog_init();
+
 	ipmi_sel_init();
 	ipmi_wdt_init();
 	ipmi_rtc_init();
-- 
2.7.4



More information about the Skiboot mailing list