diff options
author | Vasant Hegde <hegdevasant@linux.vnet.ibm.com> | 2016-07-02 21:03:40 +0530 |
---|---|---|
committer | Stewart Smith <stewart@linux.vnet.ibm.com> | 2016-07-21 16:52:08 +1000 |
commit | 71eb483122eb5ec0ef6e845d3ccf3a2a90f35e65 (patch) | |
tree | acf9eaa9e99316aff47bea4c0c46f3d61fddec4b | |
parent | 1c7d8755cf921eb392368bb32df4f952c9a6f139 (diff) | |
download | skiboot-71eb483122eb5ec0ef6e845d3ccf3a2a90f35e65.zip skiboot-71eb483122eb5ec0ef6e845d3ccf3a2a90f35e65.tar.gz skiboot-71eb483122eb5ec0ef6e845d3ccf3a2a90f35e65.tar.bz2 |
FSP/ELOG: Improve elog event states
ELOG enables event notification once new log is available. And this
will be disabled after host completes reading logs (it has to complete
both fsp_opal_elog_info and fsp_opal_elog_read).
Ideally we should disable notification as soon as host consumes event
(after fsp_opal_elog_info). Also if host fails to call fsp_opal_elog_read
(ex: situations like duplicate event), then we endup keeping notification
forever.
This patch introduces new ELOG state (ELOG_STATE_HOST_INFO). As soon
as host consumes event elog will move to this new state so that event
notification is disabled.
Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
(cherry picked from commit cec5750a4a86ff3f69e1d8817eda023f4d40c492)
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
-rw-r--r-- | hw/fsp/fsp-elog-read.c | 3 | ||||
-rw-r--r-- | include/fsp-elog.h | 1 |
2 files changed, 3 insertions, 1 deletions
diff --git a/hw/fsp/fsp-elog-read.c b/hw/fsp/fsp-elog-read.c index 72f43f7..5814aab 100644 --- a/hw/fsp/fsp-elog-read.c +++ b/hw/fsp/fsp-elog-read.c @@ -304,6 +304,7 @@ static int64_t fsp_opal_elog_info(uint64_t *opal_elog_id, } *opal_elog_id = log_data->log_id; *opal_elog_size = log_data->log_size; + fsp_elog_set_head_state(ELOG_STATE_HOST_INFO); unlock(&elog_read_lock); return OPAL_SUCCESS; } @@ -324,7 +325,7 @@ static int64_t fsp_opal_elog_read(uint64_t *buffer, uint64_t opal_elog_size, * as we know always top record of the list is fetched from FSP */ lock(&elog_read_lock); - if (elog_read_from_fsp_head_state != ELOG_STATE_FETCHED_DATA) { + if (elog_read_from_fsp_head_state != ELOG_STATE_HOST_INFO) { unlock(&elog_read_lock); return OPAL_WRONG_STATE; } diff --git a/include/fsp-elog.h b/include/fsp-elog.h index 37a1953..a796f5e 100644 --- a/include/fsp-elog.h +++ b/include/fsp-elog.h @@ -31,6 +31,7 @@ enum elog_head_state { ELOG_STATE_FETCHING, /*In the process of reading log from FSP. */ ELOG_STATE_FETCHED_INFO,/* Indicates reading log info is completed */ ELOG_STATE_FETCHED_DATA,/* Indicates reading log is completed */ + ELOG_STATE_HOST_INFO, /* Host read log info */ ELOG_STATE_NONE, /* Indicates to fetch next log */ ELOG_STATE_REJECTED, /* resend all pending logs to linux */ }; |