Received: by 2002:ab2:6309:0:b0:1fb:d597:ff75 with SMTP id s9csp117601lqt; Wed, 5 Jun 2024 20:13:13 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWELSZwRQBttr/rjZAH3mxaWzv37YkVNYuqRDdgrHCvaxgZFlyz3D3qL9NlBo+ZT42Np8EwTlgtzXNdN8qbQ3Zztphp5b8frKOQ7LKEaw== X-Google-Smtp-Source: AGHT+IHpe0yTil8H6GfcwFf816x00SkK9pZOz8HG/DnFgdLAoFJZy2qE5fwqFwXtIKrOxDw4hfC4 X-Received: by 2002:a05:6359:4c1e:b0:192:2717:4ed4 with SMTP id e5c5f4694b2df-19c6c7c6612mr528903255d.19.1717643593096; Wed, 05 Jun 2024 20:13:13 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717643593; cv=pass; d=google.com; s=arc-20160816; b=E20zLpNg+B+feRDiq135jg8ZMGoYuytWZTGd5qVLPXh195S2pZ8M0EAzfyYoQ1XiIv Irom7rWaea2wFBsYu5i1LPGRdF9qSGhtJmB9KCEuacVgYXXtxWQReuJTpCubLUaOoGjA 2GEbe15CJy+DjeYEZ7U/O9NB1jiEkhCVZxO/gOc7DcrxmXCcaqQoUfYodhGng7ZY72Ox qztkaAlKqMilvItgkTTz9hzKeb1fpxXPsSeBiMEqDyY69T3Gi60ZKu4XCjlwFxhp7Z8N 65f7niA48rZjDMBzZfrPhb6VvZ1bPy6lguOvt0MpDUoi4vqLQ88tm9Y9GVu/rqX6N1zr tvfw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=wP5F1re64dBqTVs+NRocd2FlOhY1VvrWY3wlrf/hsiY=; fh=O7W32hzrxLioy2lU7cq0myUffGADZNPHRUPmOpshY3A=; b=iDECD3dy2wF9+FrQYmlyl3lDhp9k7xmvfHQmndkiltEjmi8zW2+rpo9pqCkdVvsxnO el2CYnXY8/SWyrI9QLuC31rAQITJdwcKsC5I2eFP9g79nsl56WxV/1wuBSWSXoeKZfPN NksNymlpitGm1QF/tkBy0zdRMk/uoSOZFH4KdwrWEp6FJxmpZC1x5pzCVAHcyB4dSnfL mLE8Vh74gHscCppYmi4zFnqiXmhKS1ZQGA1LUGG7OYv/30wkykMcOgxFdLXGBIG2/2Zk ksfTpBKP38hiC0FmtrXb5M37TFMYrJ4QM/b1QprNF+UxifTn14/6iCRSh6ve/QBZZWlA f9qw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=gCEkjqvu; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-203567-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-203567-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id 41be03b00d2f7-6de20831e8esi392823a12.131.2024.06.05.20.13.12 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Jun 2024 20:13:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-203567-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=gCEkjqvu; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-203567-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-203567-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id A65F82864E6 for ; Thu, 6 Jun 2024 03:13:12 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 584D21DA58; Thu, 6 Jun 2024 03:13:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="gCEkjqvu" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7F63CC13C; Thu, 6 Jun 2024 03:13:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717643581; cv=none; b=gt53KqrJb4mfPExkxFJYeW4UpEGocmJq1p6qYOiuSjkV8k5PE+maE6b0acd4DD25h3Ut9sk9sdAoMQ8WUSjMg7SUZWdCr9WTv9v1tFGRm3b2uYgYxkJizrlSXT6zPO7x8slenliME/g09HE8ZZJSrVHkMu+bdR7uMDlPCvIYAHE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717643581; c=relaxed/simple; bh=A6CHI3Qk5QNcWjNxDFXqY9sSiqdoBBmohvQrhSQuAAc=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=GXibJxO1kTjh4LfPneTFf82iqVYAdtgEStjOCSzDFOdO/UMH0C7Oncywka3axusvypgAPO7vHw7wP/loK7ixHLkT21PAWULgkqZe5xLVE2Lmm1a0+ibqXhQ0iPcr9YtwDdx/3zlegBUJa6yZJaze9l1OfiorvTYkHiq80euP+QU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=gCEkjqvu; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 89B96C3277B; Thu, 6 Jun 2024 03:12:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1717643581; bh=A6CHI3Qk5QNcWjNxDFXqY9sSiqdoBBmohvQrhSQuAAc=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=gCEkjqvuGUzznIxy/QhFcx3h2H8X+LSku+NZPjrgaVKkvK31K/Ez5eo5R2SOgAKUw 9FuGKqnzeWRHdy/ADs5mTcjV1K4fnub+7sTAOJxHVFSKtfcIFMKyfKZofkd1rM368+ evPTba0++zwTbyV0o7c2RlFfY3oDUXi+C+7eM60bDEEtlyfM8n9hUNACY8Pwl+9E1+ 0wisKgv4zko2HEL07mKNht8ksgWShVXczHMTbG6fcfoS0eSADvNsWjE8Qi6oBBkrdK +pucy8oTZ6mtbiTX0syK2FqK9A0jt+apNYk0LmOBF8JDGvUxsgfiI7GnQ9N5cMlMY7 dTa7J9NydymOg== Date: Thu, 6 Jun 2024 03:12:57 +0000 From: Tzung-Bi Shih To: Ben Walsh Cc: Benson Leung , Guenter Roeck , "Dustin L. Howett" , Kieran Levin , Thomas =?iso-8859-1?Q?Wei=DFschuh?= , Mario Limonciello , chrome-platform@lists.linux.dev, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3 2/5] platform/chrome: cros_ec_lpc: MEC access can use an AML mutex Message-ID: References: <20240605063351.14836-1-ben@jubnut.com> <20240605063351.14836-3-ben@jubnut.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240605063351.14836-3-ben@jubnut.com> On Wed, Jun 05, 2024 at 07:33:48AM +0100, Ben Walsh wrote: > @@ -93,7 +146,9 @@ int cros_ec_lpc_io_bytes_mec(enum cros_ec_lpc_mec_io_type io_type, > else > access = ACCESS_TYPE_LONG_AUTO_INCREMENT; > > - mutex_lock(&io_mutex); > + ret = cros_ec_lpc_mec_lock(); > + if (ret) > + return ret; > > /* Initialize I/O at desired address */ > cros_ec_lpc_mec_emi_write_address(offset, access); > @@ -135,7 +190,9 @@ int cros_ec_lpc_io_bytes_mec(enum cros_ec_lpc_mec_io_type io_type, > } > > done: > - mutex_unlock(&io_mutex); > + ret = cros_ec_lpc_mec_unlock(); > + if (ret < 0) > + return ret; A nit haven't caught in previous round review: - `if (ret)` for cros_ec_lpc_mec_lock(). - `if (ret < 0)` for cros_ec_lpc_mec_unlock(). If I see the inconsistency when reading the code, it would take me further cycles for seeking why. We should fix it. No need to resend for this; I will fix it for you.