diff mbox

[19/22] FSP/LEDS: Roll back LED state update in case FSP command queuing fails

Message ID 20150205084232.12859.29907.stgit@localhost.localdomain
State Changes Requested
Headers show

Commit Message

Vasant Hegde Feb. 5, 2015, 8:42 a.m. UTC
From: Anshuman Khandual <khandual@linux.vnet.ibm.com>

The LED local state gets updated before queuing the FSP command.
If the command returns in error state, the state gets rolled back
in the function callback. But in case where the FSP command queue
it self fails, it does not get rolled back. This patch fixes this
scenario by rolling back the state change in case the FSP command
queuing itself fails.

Signed-off-by: Anshuman Khandual <khandual@linux.vnet.ibm.com>
Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
---
 hw/fsp/fsp-leds.c |    2 ++
 1 file changed, 2 insertions(+)
diff mbox

Patch

diff --git a/hw/fsp/fsp-leds.c b/hw/fsp/fsp-leds.c
index ecdc3a9..814459e 100644
--- a/hw/fsp/fsp-leds.c
+++ b/hw/fsp/fsp-leds.c
@@ -432,6 +432,8 @@  static int fsp_msg_set_led_state(struct led_set_cmd *spcn_cmd)
 	if (rc != OPAL_SUCCESS) {
 		fsp_freemsg(msg);
 		free_spcn_cmd(spcn_cmd);
+		/* Revert LED state update */
+		update_led_list(spcn_cmd->loc_code, spcn_cmd->ckpt_status);
 	}
 
 	unlock(&led_lock);