[Skiboot] [PATCH v2 5/8] FSP/LEDS: Roll back LED state update in case FSP command queuing fails

Vasant Hegde hegdevasant at linux.vnet.ibm.com
Sun Mar 8 21:48:23 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 df2f945..327adb2 100644
--- a/hw/fsp/fsp-leds.c
+++ b/hw/fsp/fsp-leds.c
@@ -423,6 +423,8 @@ static int fsp_msg_set_led_state(struct led_set_cmd *spcn_cmd)
 	if (rc != OPAL_SUCCESS) {
+		/* Revert LED state update */
+		update_led_list(spcn_cmd->loc_code, spcn_cmd->ckpt_status);

More information about the Skiboot mailing list