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:32:57 +1000 |
commit | cec5750a4a86ff3f69e1d8817eda023f4d40c492 (patch) | |
tree | f341de6f1606e295b7034baf038f1659e86f64c4 /hw/fsp | |
parent | ec366ad4e2e871096fa4c614ad7e89f5bb6f884f (diff) | |
download | skiboot-cec5750a4a86ff3f69e1d8817eda023f4d40c492.zip skiboot-cec5750a4a86ff3f69e1d8817eda023f4d40c492.tar.gz skiboot-cec5750a4a86ff3f69e1d8817eda023f4d40c492.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>
Diffstat (limited to 'hw/fsp')
-rw-r--r-- | hw/fsp/fsp-elog-read.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/hw/fsp/fsp-elog-read.c b/hw/fsp/fsp-elog-read.c index d55c858..c7582bc 100644 --- a/hw/fsp/fsp-elog-read.c +++ b/hw/fsp/fsp-elog-read.c @@ -320,6 +320,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; } @@ -340,7 +341,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; } |