aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVasant Hegde <hegdevasant@linux.vnet.ibm.com>2017-10-10 15:07:48 +0530
committerStewart Smith <stewart@linux.vnet.ibm.com>2017-10-11 19:30:04 +1100
commitd798c276b4da7559970702c2f31b12549c92741e (patch)
treebb14d0ddaa883f5b1606cb78cb5c388649a24682
parent6557a728385c3fbcef297d2c61c7d93bc539f8bb (diff)
downloadskiboot-d798c276b4da7559970702c2f31b12549c92741e.zip
skiboot-d798c276b4da7559970702c2f31b12549c92741e.tar.gz
skiboot-d798c276b4da7559970702c2f31b12549c92741e.tar.bz2
FSP/CONSOLE: Limit number of error logging
Commit c8a7535f (FSP/CONSOLE: Workaround for unresponsive ipmi daemon) added error logging when buffer is full. In some corner cases kernel may call this function multiple time and we may endup logging error again and again. This patch fixes it by generating error log only once. I think this is enough to indicate something went wrong. Also with previous patch, once console buffer is full, OPAL is returning error to payload from fsp_console_write_buffer_space(). So payload will never call fsp_console_write(). Hence move error logging logic to right place. Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
-rw-r--r--hw/fsp/fsp-console.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/hw/fsp/fsp-console.c b/hw/fsp/fsp-console.c
index 38d4474..a7baf17 100644
--- a/hw/fsp/fsp-console.c
+++ b/hw/fsp/fsp-console.c
@@ -635,20 +635,13 @@ static int64_t fsp_console_write(int64_t term_number, int64_t *length,
if (written)
return OPAL_SUCCESS;
- /*
- * FSP is still active but not reading console data. Hence
- * our console buffer became full. Most likely IPMI daemon
- * on FSP is buggy. Lets log error and return OPAL_HARDWARE
- * to payload (Linux).
- */
- log_simple_error(&e_info(OPAL_RC_CONSOLE_HANG), "FSPCON: Console "
- "buffer is full, dropping console data\n");
return OPAL_HARDWARE;
}
static int64_t fsp_console_write_buffer_space(int64_t term_number,
int64_t *length)
{
+ static bool elog_generated = false;
struct fsp_serial *fs;
struct fsp_serbuf_hdr *sb;
@@ -688,6 +681,18 @@ static int64_t fsp_console_write_buffer_space(int64_t term_number,
if (tb_compare(mftb(), fs->out_buf_timeout) != TB_AAFTERB)
return OPAL_SUCCESS;
+ /*
+ * FSP is still active but not reading console data. Hence
+ * our console buffer became full. Most likely IPMI daemon
+ * on FSP is buggy. Lets log error and return OPAL_RESOURCE
+ * to payload (Linux).
+ */
+ if (!elog_generated) {
+ elog_generated = true;
+ log_simple_error(&e_info(OPAL_RC_CONSOLE_HANG), "FSPCON: Console "
+ "buffer is full, dropping console data\n");
+ }
+
/* Timeout happened. Lets drop incoming data */
return OPAL_RESOURCE;
}