diff options
author | Samuel Mendoza-Jonas <sam.mj@au1.ibm.com> | 2015-07-28 14:31:31 +1000 |
---|---|---|
committer | Stewart Smith <stewart@linux.vnet.ibm.com> | 2015-07-31 15:32:42 +1000 |
commit | 56b7f5113e3469620c5a1f8994550c5d72f571a8 (patch) | |
tree | 3cdea0c1b7db95938c23b643b90585e38f2326f2 /hw | |
parent | 9949f7cbfe8ae1a92f0e9bb3f6ebe0e8770c6d71 (diff) | |
download | skiboot-56b7f5113e3469620c5a1f8994550c5d72f571a8.zip skiboot-56b7f5113e3469620c5a1f8994550c5d72f571a8.tar.gz skiboot-56b7f5113e3469620c5a1f8994550c5d72f571a8.tar.bz2 |
errorlog: Simplify log calling convention
Remove the callback functionality from log_error() and replace it with
the ability to append to a user data section, or add addtional user
data sections to an error log.
For multiline or otherwise complex logging the convention is now to call
opal_elog_create() to obtain a errorlog buffer and use log_append_msg()
and log_append_data() to append to the user data section. Additional
user data sections can be added to the error log via log_add_section().
The caller is then responsible for calling log_commit().
For simple logs log_simple_error() takes care of creating and committing
the error log as before.
Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
Reviewed-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'hw')
-rw-r--r-- | hw/fsp/fsp-mem-err.c | 29 |
1 files changed, 16 insertions, 13 deletions
diff --git a/hw/fsp/fsp-mem-err.c b/hw/fsp/fsp-mem-err.c index 3eaa1a3..a4b45fc 100644 --- a/hw/fsp/fsp-mem-err.c +++ b/hw/fsp/fsp-mem-err.c @@ -41,20 +41,13 @@ static LIST_HEAD(mem_error_list); */ static struct lock mem_err_lock = LOCK_UNLOCKED; -static void mem_err_info_dump(struct errorlog *buf, void *data, uint16_t size); - DEFINE_LOG_ENTRY(OPAL_RC_MEM_ERR_RES, OPAL_PLATFORM_ERR_EVT, OPAL_MEM_ERR, OPAL_MISC_SUBSYSTEM, OPAL_PREDICTIVE_ERR_GENERAL, - OPAL_NA, mem_err_info_dump); + OPAL_NA, NULL); DEFINE_LOG_ENTRY(OPAL_RC_MEM_ERR_DEALLOC, OPAL_PLATFORM_ERR_EVT, OPAL_MEM_ERR, OPAL_MISC_SUBSYSTEM, OPAL_PREDICTIVE_ERR_GENERAL, - OPAL_NA, mem_err_info_dump); - -static void mem_err_info_dump(struct errorlog *buf, void *data, uint16_t size) -{ - opal_elog_update_user_dump(buf, data, 0x44455350, size); -} + OPAL_NA, NULL); static bool send_response_to_fsp(u32 cmd_sub_mod) { @@ -192,6 +185,7 @@ static bool handle_memory_resilience(u32 cmd_sub_mod, u64 paddr) { int rc = 0; struct OpalMemoryErrorData mem_err_evt; + struct errorlog *buf; memset(&mem_err_evt, 0, sizeof(struct OpalMemoryErrorData)); /* Check arguments */ @@ -243,10 +237,14 @@ send_response: if (!rc) return send_response_to_fsp(FSP_RSP_MEM_RES); else { - log_error(&e_info(OPAL_RC_MEM_ERR_RES), - &mem_err_evt, sizeof(struct OpalMemoryErrorData), + buf = opal_elog_create(&e_info(OPAL_RC_MEM_ERR_RES), 0); + log_append_msg(buf, "OPAL_MEM_ERR: Cannot queue up memory " "resilience error event to the OS"); + log_add_section(buf, 0x44455350); + log_append_data(buf, (char *) &mem_err_evt, + sizeof(struct OpalMemoryErrorData)); + log_commit(buf); return false; } } @@ -290,6 +288,7 @@ static bool handle_memory_deallocation(u64 paddr_start, u64 paddr_end) int rc = 0; u8 err = 0; struct OpalMemoryErrorData mem_err_evt; + struct errorlog *buf; memset(&mem_err_evt, 0, sizeof(struct OpalMemoryErrorData)); /* Check arguments */ @@ -327,10 +326,14 @@ send_response: if (!rc) return send_response_to_fsp(FSP_RSP_MEM_DYN_DEALLOC); else { - log_error(&e_info(OPAL_RC_MEM_ERR_DEALLOC), - &mem_err_evt, sizeof(struct OpalMemoryErrorData), + buf = opal_elog_create(&e_info(OPAL_RC_MEM_ERR_DEALLOC), 0); + log_append_msg(buf, "OPAL_MEM_ERR: Cannot queue up memory " "deallocation error event to the OS"); + log_add_section(buf, 0x44455350); + log_append_data(buf, (char *)&mem_err_evt, + sizeof(struct OpalMemoryErrorData)); + log_commit(buf); return false; } } |