From patchwork Tue Jun 16 10:52:46 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ananth N Mavinakayanahalli X-Patchwork-Id: 484950 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [103.22.144.68]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3C277140284 for ; Tue, 16 Jun 2015 20:56:12 +1000 (AEST) Received: from ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 22D2D1A0780 for ; Tue, 16 Jun 2015 20:56:12 +1000 (AEST) X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Received: from e28smtp04.in.ibm.com (e28smtp04.in.ibm.com [122.248.162.4]) (using TLSv1 with cipher CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 5A07A1A06DB for ; Tue, 16 Jun 2015 20:56:08 +1000 (AEST) Received: from /spool/local by e28smtp04.in.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 16 Jun 2015 16:26:05 +0530 Received: from d28dlp02.in.ibm.com (9.184.220.127) by e28smtp04.in.ibm.com (192.168.1.134) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Tue, 16 Jun 2015 16:26:03 +0530 X-Helo: d28dlp02.in.ibm.com X-MailFrom: ananth@in.ibm.com X-RcptTo: skiboot@lists.ozlabs.org Received: from d28relay04.in.ibm.com (d28relay04.in.ibm.com [9.184.220.61]) by d28dlp02.in.ibm.com (Postfix) with ESMTP id 959443940066 for ; Tue, 16 Jun 2015 16:26:01 +0530 (IST) Received: from d28av03.in.ibm.com (d28av03.in.ibm.com [9.184.220.65]) by d28relay04.in.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id t5GArWE157606316 for ; Tue, 16 Jun 2015 16:25:43 +0530 Received: from d28av03.in.ibm.com (localhost [127.0.0.1]) by d28av03.in.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id t5G9u48c010759 for ; Tue, 16 Jun 2015 15:26:04 +0530 Received: from thinktux.in.ibm.com (thinktux.in.ibm.com [9.124.31.67] (may be forged)) by d28av03.in.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id t5G9u3rA010727 for ; Tue, 16 Jun 2015 15:26:03 +0530 From: Ananth N Mavinakayanahalli To: skiboot@lists.ozlabs.org Date: Tue, 16 Jun 2015 16:22:46 +0530 Message-ID: <20150616105246.2924.82244.stgit@thinktux.in.ibm.com> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 15061610-0013-0000-0000-000005C153DF Subject: [Skiboot] [PATCH] [lpc] Fix locking X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.20 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" Release lock before bailing out. Signed-off-by: Ananth N Mavinakayanahalli --- hw/lpc.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/hw/lpc.c b/hw/lpc.c index b287020..da1e56d 100644 --- a/hw/lpc.c +++ b/hw/lpc.c @@ -343,10 +343,9 @@ static int64_t __lpc_write(uint32_t chip_id, enum OpalLPCAddressType addr_type, /* Perform OPB access */ rc = opb_write(chip, opb_base + addr, data, sz); - unlock(&chip->lpc_lock); - /* XXX Add LPC error handling/recovery */ bail: + unlock(&chip->lpc_lock); return rc; }