[Skiboot] [PATCH 11/22] FSP/LEDS: Check FSP response status

Vasant Hegde hegdevasant at linux.vnet.ibm.com
Thu Feb 5 19:40:07 AEDT 2015


Presently we check only selected status from SPCN passthrough
command. So if MBOX command fails for any other reason then
we endup considering that as success...which is not correct.

This patch considers all response status except success as fail.

Also removes unnecessary variable (fail).

Signed-off-by: Vasant Hegde <hegdevasant at linux.vnet.ibm.com>
---
 hw/fsp/fsp-leds.c |   11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/hw/fsp/fsp-leds.c b/hw/fsp/fsp-leds.c
index ca39d2f..f2fb501 100644
--- a/hw/fsp/fsp-leds.c
+++ b/hw/fsp/fsp-leds.c
@@ -234,7 +234,6 @@ enclosure:
 
 static void fsp_spcn_set_led_completion(struct fsp_msg *msg)
 {
-	bool fail;
 	u16 ckpt_status;
 	char loc_code[LOC_CODE_SIZE + 1];
 	struct fsp_msg *resp = msg->resp;
@@ -245,13 +244,11 @@ static void fsp_spcn_set_led_completion(struct fsp_msg *msg)
 	/*
 	 * LED state update request came as part of FSP async message
 	 * FSP_CMD_SET_LED_STATE, hence need to send response message.
+	 *
+	 * Also if SPCN command failed, then identify the command and
+	 * roll back changes.
 	 */
-	fail = (status == FSP_STATUS_INVALID_DATA) ||
-		(status == FSP_STATUS_DMA_ERROR) ||
-		(status == FSP_STATUS_SPCN_ERROR);
-
-	/* SPCN command failed: Identify the command and roll back changes */
-	if (fail) {
+	if (status != FSP_STATUS_SUCCESS) {
 		log_simple_error(&e_info(OPAL_RC_LED_SPCN),
 			PREFIX "Last SPCN command failed, status=%02x\n",
 			status);



More information about the Skiboot mailing list