Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp1298219ybt; Thu, 25 Jun 2020 02:41:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxzwzdpjELEZdkqPqjOW3cAS3NJ2VCJ0yTz3XwkwCRt1zysqMoafQfRo/Enu9fxTkdIKV41 X-Received: by 2002:a17:906:2e4b:: with SMTP id r11mr23098443eji.227.1593078083740; Thu, 25 Jun 2020 02:41:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593078083; cv=none; d=google.com; s=arc-20160816; b=bRQnCZhBfWuIB6QfemGbDSodX9TyEyfFebwnp5KIiv37NMOTrMzTvii1R27SjllHYP HnE8Mbg1jlOOir1asw+u1nfvZwSnOon4Z5wtt1g0Cbnijpqhfy28Wi2g5EcuhHhzRbRc EPdfwrvqQObuTAV0un1JIds0xwFStfpH8eVTlYARVbsLy0yCmAnmEpsQfyIm78aMVVdY b/DYcE1uP3lnc30d0lGpj1UNU44l3nNotXCYJ0zBrmlpwzjI4KXbQe99tFHpzxZhs4I6 4WZznW7HoerIyBmRroyZbuvgm2kg70o79q0e8PPN/PGIv/0LY2QfxSA6PtPjOs5afWIX f4UA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=eJlxbY6IDfSdh2dHCykzMuYmJoJ7ZQY/TJ4RnUtFdac=; b=VvZo9tguxRo+N4wOvFrpFxRe9eNJAHhW4aRNDuHW/NbMkGtnuhbiAfTGpeMhcsrhJQ fq/Waf96c3VW07wN0fX+Stap1YvW+rzKz4nwe2djEVjR3HgOpHB3Fy9FVMofU8/AzD86 Kk/VZpV0Wtv97JCzZOtbVJ7cS8Okx7ZojjxX/9uXhitDPupUI0FLA8oLLieJRuWMp85s DVnh70jlMSK79DExiiQtzYJo/ygj3J86WnfcfQ4lLuEPFF9GwVoPwmK4vZgmODZbR4Nd PTnAIkUgLiDAjxySgoyGpzQ8vZ8xNR9ZWAKaUn94v9HldZ6Lj5xRO9qfXH/tWoCNdPDg 0pBQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a15si16747471edl.117.2020.06.25.02.40.59; Thu, 25 Jun 2020 02:41:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390611AbgFYI0d (ORCPT + 99 others); Thu, 25 Jun 2020 04:26:33 -0400 Received: from bhuna.collabora.co.uk ([46.235.227.227]:33578 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389747AbgFYI0d (ORCPT ); Thu, 25 Jun 2020 04:26:33 -0400 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: eballetbo) with ESMTPSA id 427D72A5107 Subject: Re: [PATCH] platform/chrome: fix a double-unlock issue To: wu000273@umn.edu, bleung@chromium.org Cc: groeck@chromium.org, linux-kernel@vger.kernel.org, kjlu@umn.edu, Jett Rink , Mathew King , Enrico Granata References: <20200523031608.17918-1-wu000273@umn.edu> From: Enric Balletbo i Serra Message-ID: <8d81a91b-4c1d-d0e1-60d0-a68f6ef65bd0@collabora.com> Date: Thu, 25 Jun 2020 10:26:28 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.9.0 MIME-Version: 1.0 In-Reply-To: <20200523031608.17918-1-wu000273@umn.edu> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Qiushi, Thank you for your patch. On 23/5/20 5:16, wu000273@umn.edu wrote: > From: Qiushi Wu > > In function cros_ec_ishtp_probe(), "up_write" is already called > before function "cros_ec_dev_init". But "up_write" will be called > again after the calling of the function "cros_ec_dev_init" failed. > Thus add a call of the function “down_write” in this if branch > for the completion of the exception handling. > > Fixes: 26a14267aff2 ("platform/chrome: Add ChromeOS EC ISHTP driver") > Signed-off-by: Qiushi Wu The change looks good to me, but I'd like someone having the hardware giving a Tested-by tag, so cc'ing some chromeos people. They must be also interested on backport this patch. > --- > drivers/platform/chrome/cros_ec_ishtp.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/drivers/platform/chrome/cros_ec_ishtp.c b/drivers/platform/chrome/cros_ec_ishtp.c > index 93a71e93a2f1..41d60af618c9 100644 > --- a/drivers/platform/chrome/cros_ec_ishtp.c > +++ b/drivers/platform/chrome/cros_ec_ishtp.c > @@ -660,8 +660,10 @@ static int cros_ec_ishtp_probe(struct ishtp_cl_device *cl_device) > > /* Register croc_ec_dev mfd */ > rv = cros_ec_dev_init(client_data); > - if (rv) > + if (rv) { > + down_write(&init_lock); > goto end_cros_ec_dev_init_error; > + } > > return 0; > >