Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp735513ybt; Fri, 26 Jun 2020 10:15:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzktWL6NFUN/gnjyeP0zIHEQezyr5Xwh9E2+Bq1BMSGItcjibM1Z3nbbmJGVO7moW4N1O1F X-Received: by 2002:aa7:db57:: with SMTP id n23mr4303304edt.235.1593191705756; Fri, 26 Jun 2020 10:15:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593191705; cv=none; d=google.com; s=arc-20160816; b=wTK2ybnUxIopCbR8YGKef0FwnaeMh6n0Xpt26VOHE8z4+kW7qhdBihdVojSY+Wo1Pj 14oZrbVVdLG2SNNqHHEK3Prwvn9B+ocX8aqLKchd6wcbvxnIdN0S8loktWUyv6PwlXNy I+bsMLWHhi3ly9bsZIgzbSPRzDF416T5rsFFy8F5OQSfdLj/xdjrtl7gg23JTzw2Hx8r UrZ1HA0o0FnyvMNFUxPXW79dDvc6WHYfmHzPVJH7BgarFNyluQ4EsGjSzMNL3SOEK48F 2WXWu/Xq4n8VflSCu2yEnPDXnV6JNH45MaJOUJRVXhhhqKwX8Zyi0hnHwUzTyuG9A9Kl S71Q== 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:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=vBgkqduIoiDQZRNDloYMKFR5pMrC2D5+LBXw6ASMqtY=; b=JNizo9uo9nJfKPnb+vS50X+LItqln9jVTDRBio1nfaLq1Ovpxay7vIUJ53lJ+ruR+q sPbccMDVgWHuPhR+EGKFByHh0eoOpeAIbajPWWQ7AIcbJhl+2qGvFumLP/wBlA3GRlIJ Nugw0mtoSOasia0kHq388wAWSrKR9jjiIO1r4quynNYiwTwg3hClMx7Aw16L5jt8GyWg tHygvH8cUeA4PJIDy04MNFfjZHTOheyk3UzOkrd6/p6wv1mDPGoAt+mBqItbEwmljL6j ZFw964cnNO8WZX/hV3bpl+H16AFTjBJoLSFEGMumPPOBCBkYY5/BYhHFzVRpa0cUfWoZ 1uWg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=W1jKttVP; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j13si11656604ejc.314.2020.06.26.10.14.42; Fri, 26 Jun 2020 10:15:05 -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; dkim=pass header.i=@google.com header.s=20161025 header.b=W1jKttVP; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726315AbgFZQBz (ORCPT + 99 others); Fri, 26 Jun 2020 12:01:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57652 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725807AbgFZQBz (ORCPT ); Fri, 26 Jun 2020 12:01:55 -0400 Received: from mail-pj1-x1042.google.com (mail-pj1-x1042.google.com [IPv6:2607:f8b0:4864:20::1042]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0E43FC03E979 for ; Fri, 26 Jun 2020 09:01:55 -0700 (PDT) Received: by mail-pj1-x1042.google.com with SMTP id cm23so5125869pjb.5 for ; Fri, 26 Jun 2020 09:01:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=vBgkqduIoiDQZRNDloYMKFR5pMrC2D5+LBXw6ASMqtY=; b=W1jKttVPL03wpCJ++3iirIT+cOM26MtJz9eUZ+i67X8bip7EOCdRedzXBiRA9/OtmW FmnrPd6Nny84NKa8adb+stMBy3NIisy09LOb2Cj4+OD0kFzlvZzzJTwrE4VPNDjSqGtU HYOhsV03kmPz+99JvNj2a8EnGSIVb4eVQ9CYc2kUTLPLZcQp9nu26kK0xltSl/34pUA7 TfgV7Y39VZNN0BCrGMNxVifXIbEA1kQjVVn8rL+jXfwC7MfC3yb4JgqWwmWmsliOhOR7 h91mzrK5vefVAh8EMRnp/pdGn+rFtPwqzUvYa2X8ibuMmKTCHz7fOC45DnguhQ0ovomi WqGg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=vBgkqduIoiDQZRNDloYMKFR5pMrC2D5+LBXw6ASMqtY=; b=GcojPm1Ry6UbYhNxlWzJC61tC+9bxQ+TYL2gzW5B2qs9yKrAyBejJyNK9jVgmRTeID yuQa6z4+Z2q9aSZjItwiP5X161TwpYyTEDhm/D+2fol+LNLJTjlWKG22+lpSvEyNpuFj r+iXdHXaB+YXVvzMWowTXlhK8+aW/4MJ8sWSausWmO5FaHIL/ncQ8bIPMSv4uI90ztNE AGD8cXZu4u1GuxorMju1spfwp3T/ALLy6G7dLqEdeMHLR7A5KOxxXvMyL/XxrvH0rLZp FmMV4nC9UvlAU+vQwXw3ClH1/IHTh07d1fnLx7WrYlVsnN6FZ71+w6OSewq7JTOz4EhT mnQQ== X-Gm-Message-State: AOAM530IV1/y9uHVU7d8C3aBxY+KsHncxCzxbNXHVEtP7UnuAIi8Qens 7PsAavSmPYrscq9r5AEaDlXrb1M8oWfwOFlZvVzllg== X-Received: by 2002:a17:90a:ff0c:: with SMTP id ce12mr3517668pjb.100.1593187314284; Fri, 26 Jun 2020 09:01:54 -0700 (PDT) MIME-Version: 1.0 References: <20200523031608.17918-1-wu000273@umn.edu> <8d81a91b-4c1d-d0e1-60d0-a68f6ef65bd0@collabora.com> In-Reply-To: <8d81a91b-4c1d-d0e1-60d0-a68f6ef65bd0@collabora.com> From: Mat King Date: Fri, 26 Jun 2020 10:01:43 -0600 Message-ID: Subject: Re: [PATCH] platform/chrome: fix a double-unlock issue To: Enric Balletbo i Serra Cc: wu000273@umn.edu, Benson Leung , Guenter Roeck , Linux Kernel Mailing List , kjlu@umn.edu, Jett Rink , Mathew King , Enrico Granata Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jun 25, 2020 at 2:26 AM Enric Balletbo i Serra wrote: > > 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 =E2=80=9Cdown_write=E2=80=9D 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 Tested-by: Mathew King Signed-off-by: Mathew King > > The change looks good to me, but I'd like someone having the hardware giv= ing a > Tested-by tag, so cc'ing some chromeos people. They must be also interest= ed on > backport this patch. Tested on a device with ish based cros EC. Looks good to me. > > > --- > > 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_dev= ice *cl_device) > > > > /* Register croc_ec_dev mfd */ > > rv =3D cros_ec_dev_init(client_data); > > - if (rv) > > + if (rv) { > > + down_write(&init_lock); > > goto end_cros_ec_dev_init_error; > > + } > > > > return 0; > > > >