diff options
author | Vasant Hegde <hegdevasant@linux.vnet.ibm.com> | 2017-10-10 15:07:48 +0530 |
---|---|---|
committer | Stewart Smith <stewart@linux.vnet.ibm.com> | 2017-10-11 19:30:30 +1100 |
commit | 374fde2777647b8f78347c749630fb81d35bae24 (patch) | |
tree | 2e2f60d91658c574e4690e427ec7491e8704f586 /hw/fsp | |
parent | 8d59f26e7e652a449d13ad9c1710c324500b38d3 (diff) | |
download | skiboot-374fde2777647b8f78347c749630fb81d35bae24.zip skiboot-374fde2777647b8f78347c749630fb81d35bae24.tar.gz skiboot-374fde2777647b8f78347c749630fb81d35bae24.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>
(cherry picked from commit d798c276b4da7559970702c2f31b12549c92741e)
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'hw/fsp')
-rw-r--r-- | hw/fsp/fsp-console.c | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/hw/fsp/fsp-console.c b/hw/fsp/fsp-console.c index 5277054..cb96dd1 100644 --- a/hw/fsp/fsp-console.c +++ b/hw/fsp/fsp-console.c @@ -632,20 +632,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; @@ -685,6 +678,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; } |