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

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


From: Anshuman Khandual <khandual at 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 at linux.vnet.ibm.com>
Signed-off-by: Vasant Hegde <hegdevasant at linux.vnet.ibm.com>
---
 hw/fsp/fsp-leds.c |    2 ++
 1 file changed, 2 insertions(+)

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);



More information about the Skiboot mailing list