diff --git a/hw/fsp/fsp-console.c b/hw/fsp/fsp-console.c index 8eaf7b82e13c..ae7176146719 100644 --- a/hw/fsp/fsp-console.c +++ b/hw/fsp/fsp-console.c @@ -26,6 +26,11 @@ #include #include #include +#include + +DEFINE_LOG_ENTRY(OPAL_RC_CONSOLE_HANG, OPAL_PLATFORM_ERR_EVT, OPAL_CONSOLE, + OPAL_PLATFORM_FIRMWARE, + OPAL_PREDICTIVE_ERR_GENERAL, OPAL_NA); struct fsp_serbuf_hdr { u16 partition_id; @@ -611,7 +616,18 @@ static int64_t fsp_console_write(int64_t term_number, int64_t *length, *length = written; unlock(&fsp_con_lock); - return written ? OPAL_SUCCESS : OPAL_BUSY_EVENT; + 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, diff --git a/include/errorlog.h b/include/errorlog.h index e9d5ad86f3d6..285c185d0b86 100644 --- a/include/errorlog.h +++ b/include/errorlog.h @@ -332,6 +332,9 @@ enum opal_reasoncode { /* Platform error */ OPAL_RC_ABNORMAL_REBOOT = OPAL_SRC_COMPONENT_CEC | 0x10, + +/* FSP console */ + OPAL_RC_CONSOLE_HANG = OPAL_SRC_COMPONENT_CONSOLE | 0x10, }; #define DEFINE_LOG_ENTRY(reason, type, id, subsys, \