diff options
author | Vasant Hegde <hegdevasant@linux.vnet.ibm.com> | 2016-03-10 12:13:52 +0530 |
---|---|---|
committer | Stewart Smith <stewart@linux.vnet.ibm.com> | 2016-03-11 15:24:39 +1100 |
commit | 2c0aee589932806ecf075c61b5027eed962f7c9c (patch) | |
tree | 7cb4677025e153f570ab7610ca485e71474b7c58 /hw/ipmi | |
parent | b3dae4b9de489d831474d7add8bf6b0b4aa5c0d5 (diff) | |
download | skiboot-2c0aee589932806ecf075c61b5027eed962f7c9c.zip skiboot-2c0aee589932806ecf075c61b5027eed962f7c9c.tar.gz skiboot-2c0aee589932806ecf075c61b5027eed962f7c9c.tar.bz2 |
ipmi-sel: Fix esel event logger to handle early boot PANIC events
We pre-allocate IPMI message for PANIC event and use that memory to send
PANIC event to BMC. Presently we return NULL if we have not initiated PANIC
event message. So we won't be able to log early failure events.
This patch tries to initialize ipmi message instead of returning NULL.
Also intialize elog before ipmi_sel_init. Otherwise we will not be able
to create elog message.
Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'hw/ipmi')
-rw-r--r-- | hw/ipmi/ipmi-sel.c | 27 |
1 files changed, 17 insertions, 10 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); -} |