@@ -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);
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@linux.vnet.ibm.com> --- hw/fsp/fsp-leds.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-)