diff mbox

[2/6] FSP/ELOG: Use elog REJECT state properly

Message ID 20150407125240.27067.24910.stgit@localhost.localdomain
State Accepted
Headers show

Commit Message

Vasant Hegde April 7, 2015, 12:55 p.m. UTC
Presently we continue to read error log even though elog state is
"REJECTED". This patch fixes this by rearraning code.

Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
---
 hw/fsp/fsp-elog-read.c |    9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
diff mbox

Patch

diff --git a/hw/fsp/fsp-elog-read.c b/hw/fsp/fsp-elog-read.c
index 88972ca..0442e1a 100644
--- a/hw/fsp/fsp-elog-read.c
+++ b/hw/fsp/fsp-elog-read.c
@@ -197,6 +197,11 @@  static void fsp_elog_read_complete(struct fsp_msg *read_msg)
 	val = (read_msg->resp->word1 >> 8) & 0xff;
 	fsp_freemsg(read_msg);
 
+	if (elog_read_from_fsp_head_state == ELOG_STATE_REJECTED) {
+		fsp_elog_set_head_state(ELOG_STATE_NONE);
+		goto elog_read_out;
+	}
+
 	switch (val) {
 	case FSP_STATUS_SUCCESS:
 		fsp_elog_set_head_state(ELOG_STATE_FETCHED_DATA);
@@ -219,8 +224,8 @@  static void fsp_elog_read_complete(struct fsp_msg *read_msg)
 	default:
 		fsp_elog_fetch_failure(val);
 	}
-	if (elog_read_from_fsp_head_state == ELOG_STATE_REJECTED)
-		fsp_elog_set_head_state(ELOG_STATE_NONE);
+
+elog_read_out:
 	unlock(&elog_read_lock);
 
 	/* Check if a new log needs fetching */