diff options
author | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2015-03-27 13:49:41 +1100 |
---|---|---|
committer | Stewart Smith <stewart@linux.vnet.ibm.com> | 2015-03-31 15:41:26 +1100 |
commit | f35cbce965991f04ad253bd83989c259b375a745 (patch) | |
tree | 74c89819368e4844f214f902eedf77005528b2db | |
parent | 5dea3e71fc7fd13d7a2aeb966d78043b74227394 (diff) | |
download | skiboot-f35cbce965991f04ad253bd83989c259b375a745.zip skiboot-f35cbce965991f04ad253bd83989c259b375a745.tar.gz skiboot-f35cbce965991f04ad253bd83989c259b375a745.tar.bz2 |
elog: Don't call uninitialized platform elog_commit
Some platforms fail to initialize it and bad things ensure
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Acked-by: Jeremy Kerr <jk@ozlabs.org>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
-rw-r--r-- | core/errorlog.c | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/core/errorlog.c b/core/errorlog.c index a5b1dbb..d0ca71f 100644 --- a/core/errorlog.c +++ b/core/errorlog.c @@ -119,6 +119,19 @@ void opal_elog_complete(struct errorlog *buf, bool success) unlock(&elog_lock); } +static void elog_commit(struct errorlog *elog) +{ + int rc; + + if (platform.elog_commit) { + rc = platform.elog_commit(elog); + if (rc) + prerror("ELOG: Platform commit error %d\n", rc); + return; + } + opal_elog_complete(elog, false); +} + void log_error(struct opal_err_info *e_info, void *data, uint16_t size, const char *fmt, ...) { @@ -142,8 +155,7 @@ void log_error(struct opal_err_info *e_info, void *data, uint16_t size, /* Append any number of call out dumps */ if (e_info->call_out) e_info->call_out(buf, data, size); - if (platform.elog_commit(buf)) - prerror("ELOG: Re-try error logging\n"); + elog_commit(buf); } } @@ -166,8 +178,7 @@ void log_simple_error(struct opal_err_info *e_info, const char *fmt, ...) prerror("ELOG: Error getting buffer to log error\n"); else { opal_elog_update_user_dump(buf, err_msg, tag, strlen(err_msg)); - if (platform.elog_commit(buf)) - prerror("ELOG: Re-try error logging\n"); + elog_commit(buf); } } |