From patchwork Thu Feb 5 08:42:32 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vasant Hegde X-Patchwork-Id: 436691 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 8A330140216 for ; Thu, 5 Feb 2015 19:42:44 +1100 (AEDT) Received: from ozlabs.org (ozlabs.org [103.22.144.67]) by lists.ozlabs.org (Postfix) with ESMTP id 5CEDA1A0F9E for ; Thu, 5 Feb 2015 19:42:44 +1100 (AEDT) X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Received: from e28smtp06.in.ibm.com (e28smtp06.in.ibm.com [122.248.162.6]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 8B80F1A0EC9 for ; Thu, 5 Feb 2015 19:42:38 +1100 (AEDT) Received: from /spool/local by e28smtp06.in.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 5 Feb 2015 14:12:36 +0530 Received: from d28dlp01.in.ibm.com (9.184.220.126) by e28smtp06.in.ibm.com (192.168.1.136) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Thu, 5 Feb 2015 14:12:35 +0530 Received: from d28relay04.in.ibm.com (d28relay04.in.ibm.com [9.184.220.61]) by d28dlp01.in.ibm.com (Postfix) with ESMTP id ADFCEE004C for ; Thu, 5 Feb 2015 14:14:02 +0530 (IST) Received: from d28av05.in.ibm.com (d28av05.in.ibm.com [9.184.220.67]) by d28relay04.in.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id t158gWvW14680236 for ; Thu, 5 Feb 2015 14:12:32 +0530 Received: from d28av05.in.ibm.com (localhost [127.0.0.1]) by d28av05.in.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id t158gWUY026153 for ; Thu, 5 Feb 2015 14:12:32 +0530 Received: from localhost.localdomain ([9.124.35.64]) by d28av05.in.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id t158gWGk026150 for ; Thu, 5 Feb 2015 14:12:32 +0530 From: Vasant Hegde To: skiboot@lists.ozlabs.org Date: Thu, 05 Feb 2015 14:12:32 +0530 Message-ID: <20150205084232.12859.29907.stgit@localhost.localdomain> In-Reply-To: <20150205083611.12859.41225.stgit@localhost.localdomain> References: <20150205083611.12859.41225.stgit@localhost.localdomain> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 15020508-0021-0000-0000-000003A6ACB3 Subject: [Skiboot] [PATCH 19/22] FSP/LEDS: Roll back LED state update in case FSP command queuing fails X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Mailing list for skiboot development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" From: Anshuman Khandual 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 Signed-off-by: Vasant Hegde --- 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);