diff options
-rw-r--r-- | hw/ipmi/ipmi-sel.c | 27 | ||||
-rw-r--r-- | platforms/astbmc/common.c | 3 |
2 files changed, 19 insertions, 11 deletions
diff --git a/hw/ipmi/ipmi-sel.c b/hw/ipmi/ipmi-sel.c index 8d10b6f..6bc386a 100644 --- a/hw/ipmi/ipmi-sel.c +++ b/hw/ipmi/ipmi-sel.c @@ -138,6 +138,18 @@ static struct ipmi_sel_panic_msg ipmi_sel_panic_msg; /* Forward declaration */ static void ipmi_elog_poll(struct ipmi_msg *msg); +void ipmi_sel_init(void) +{ + /* Already done */ + if (ipmi_sel_panic_msg.msg != NULL) + return; + + memset(&ipmi_sel_panic_msg, 0, sizeof(struct ipmi_sel_panic_msg)); + ipmi_sel_panic_msg.msg = ipmi_mkmsg(IPMI_DEFAULT_INTERFACE, + IPMI_RESERVE_SEL, ipmi_elog_poll, + NULL, NULL, IPMI_MAX_REQ_SIZE, 2); +} + /* * Allocate IPMI message * For normal event, allocate memory using ipmi_mkmsg and for PANIC @@ -149,8 +161,11 @@ static struct ipmi_msg *ipmi_sel_alloc_msg(struct errorlog *elog_buf) if (elog_buf->event_severity == OPAL_ERROR_PANIC) { /* Called before initialization completes */ - if (ipmi_sel_panic_msg.msg == NULL) - return NULL; + if (ipmi_sel_panic_msg.msg == NULL) { + ipmi_sel_init(); /* Try to allocate IPMI message */ + if (ipmi_sel_panic_msg.msg == NULL) + return NULL; + } if (ipmi_sel_panic_msg.busy == true) return NULL; @@ -552,11 +567,3 @@ void ipmi_parse_sel(struct ipmi_msg *msg) sel.cmd); } } - -void ipmi_sel_init(void) -{ - memset(&ipmi_sel_panic_msg, 0, sizeof(struct ipmi_sel_panic_msg)); - ipmi_sel_panic_msg.msg = ipmi_mkmsg(IPMI_DEFAULT_INTERFACE, - IPMI_RESERVE_SEL, ipmi_elog_poll, - NULL, NULL, IPMI_MAX_REQ_SIZE, 2); -} diff --git a/platforms/astbmc/common.c b/platforms/astbmc/common.c index 40a9fc8..1ed7d42 100644 --- a/platforms/astbmc/common.c +++ b/platforms/astbmc/common.c @@ -115,12 +115,13 @@ void astbmc_init(void) /* Register the BT interface with the IPMI layer */ bt_init(); + /* Initialize elog */ + elog_init(); ipmi_sel_init(); ipmi_wdt_init(); ipmi_rtc_init(); ipmi_opal_init(); astbmc_fru_init(); - elog_init(); ipmi_sensor_init(); /* As soon as IPMI is up, inform BMC we are in "S0" */ |