Received: by 2002:ab2:6816:0:b0:1f9:5764:f03e with SMTP id t22csp2340591lqo; Mon, 20 May 2024 02:46:43 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXrEm2Z3iBctsxe5zrXQZT9EaDn/MSib0LovOjh73aelVmFQXQYnzlRk2oohFXYwkh1rybMmL0DZV+bHYwgU30WmziBPoXEdCbdzxeF3Q== X-Google-Smtp-Source: AGHT+IFJeqcO3bOgkqg2iYvnM/WJvpNZJdLxT15a2TnxZxjtqrDUSkukPEHaeZP2TuwdXeUNTEeJ X-Received: by 2002:a05:6a20:978e:b0:1a7:8dd9:5fd3 with SMTP id adf61e73a8af0-1b1ca3ea113mr6958488637.18.1716198402669; Mon, 20 May 2024 02:46:42 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716198402; cv=pass; d=google.com; s=arc-20160816; b=JuYVg0wgw10YZWl22W1js/tuDrOCqWS2JOILV/VCQjt0IqRQDRCinrsUilzi9zftm6 4hxN6Dz/DWXlHAFmeZL6iHYlixcvzp30ZtcecgTdxG+b9+CObwuxUfEzF8QjyJPuI+vE hK0b689uO1fnAIfDOnPDp+/IG8MCb+fA11O//CcpkFkOLbg1/6cFy9K33q4T8DsyvXe4 CR/ig5JN1ZBKj9MWeRagdQu8sEUpbq5rFeKXfO5o8O+HCKCDbk3B5+wsUpgaDow+DwSR JY5xkfY7u6xDgcoPhc4pEYxc2fITNHovJ3SWmNmyCcuP32wCb+EAYleWh1evNqx6Nu7B CXXw== 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=xmBrYy6L9T+wGo37fhJaCBsUhvDXr+6Xaex5N8+BoA4=; fh=O7W32hzrxLioy2lU7cq0myUffGADZNPHRUPmOpshY3A=; b=FlwV7szxVfYlyTrzN+y3vCY2mU7juzio24H9nEeKwKHtOk53KHJojs7oBAx7ZPBbbr +shOx9jeb1BeDabJ0gjb91FHu3sfRJ4rBM2TMFDfpky55Vj+SUMCr5VRdsr5rs7O2Z6r exHpKi+tILSLFCZvQIch/qkA2sG1QAqP4Cqua7BbCWOd63Nl6MYEtIqejqwP+jHXGZWz pg+nx9LztnXpTVsUxXQSikhSr25eHd60W4YSmPmoNxmRQwlaPJI4eUv4fTK088O+Jx+Y ZeZhO4zVj4+szE0E5YMq0eDnQ6AvfrmVJbu/79UfmdWq690ohXXGbQwp0R5B6BYs7oyH q/Zw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ppRk1q5T; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-183562-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-183562-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. [139.178.88.99]) by mx.google.com with ESMTPS id 41be03b00d2f7-63412863e34si22009930a12.635.2024.05.20.02.46.42 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 May 2024 02:46:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-183562-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ppRk1q5T; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-183562-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-183562-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 EFB8A281EBB for ; Mon, 20 May 2024 09:46:20 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7FEEA43AC0; Mon, 20 May 2024 09:46:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="ppRk1q5T" 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 A47403F9D5; Mon, 20 May 2024 09:46:14 +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=1716198374; cv=none; b=UOuZoUFpboR6TFUbQ9mFEEI1qgIpD9yTPxfYrvUsXgMp3tFJsGiXCTs2R3TCinKQjkdJTJSE8UYSPzzKvTpwdfdtjWoorc/uG8kRljX3BSGliV1235WLUanHuhYZC9AgzstSJxTLOj4wnB4oifD56gG8MXKug4r+11gr2Q1wo3U= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716198374; c=relaxed/simple; bh=CD3m2FyYVSHZBS38YWRS5VaJJDhV0ca02GYxBwY0yz4=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=nRkdzjkzH+HPSTPPwh/eOi8qkvgH9SjBCSy+0wdd38g0GUUrszNMiFBc8PNwk1rVKHo8lhz8fJinSbQ+Eb1885ptBVQCI3W34Z7yuphwKLO4bj1NjL4+KGFaFffhtvSHeH9ZNsZpFQJtoWmWd7YM0uwMQ9DtpqARanWME9yXJAI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=ppRk1q5T; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 023A0C2BD10; Mon, 20 May 2024 09:46:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1716198374; bh=CD3m2FyYVSHZBS38YWRS5VaJJDhV0ca02GYxBwY0yz4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ppRk1q5TcZHo28GUlKxf2Wu3Lk0loPbLNnBYXtIxQzE3xR+cKoG54d7xubyRGno8O WiBSAqr5foCmcJVuT0B8Shp2PzDXfKGuYPYlRTz6lH8QPNCULFRj5qGtXbd+Fbn6Gb aIZuTSKn/mJM/mZcDaTUYzXWjrJY/0wRNCVuVIaT7Jdvwld0xeFVwcNXwBGQVpvClu Yzoh8nYBf92OJeIjI9+M6tjt5BkZm0R2boCRU/9UFbmDJczBiLQfwyvIhqEC6wsXYQ f49XjWW5Zj6eEaf5PSknTvg3deRldgXAwowJSpxRvF5/kwsLPiDexfOAOiju2SSlju z1Qvxg8uaiugQ== Date: Mon, 20 May 2024 17:46:11 +0800 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 2/6] platform/chrome: cros_ec_lpc: MEC access can use an AML mutex Message-ID: References: <20240515055631.5775-1-ben@jubnut.com> <20240515055631.5775-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: <20240515055631.5775-3-ben@jubnut.com> On Wed, May 15, 2024 at 06:56:27AM +0100, Ben Walsh wrote: > diff --git a/drivers/platform/chrome/cros_ec_lpc_mec.c b/drivers/platform/chrome/cros_ec_lpc_mec.c [...] > +static int cros_ec_lpc_mec_lock(void) > +{ > + bool success; > + > + if (!aml_mutex) { > + mutex_lock(&io_mutex); > + return 0; > + } > + > + success = ACPI_SUCCESS(acpi_acquire_mutex(aml_mutex, > + NULL, ACPI_LOCK_DELAY_MS)); > + > + if (!success) { > + pr_info("%s failed.", __func__); > + return -EBUSY; I guess it doesn't need to print anything as the -EBUSY should be propagated correctly now. > +static int cros_ec_lpc_mec_unlock(void) > +{ > + bool success; > + > + if (!aml_mutex) { > + mutex_unlock(&io_mutex); > + return 0; > + } > + > + success = ACPI_SUCCESS(acpi_release_mutex(aml_mutex, NULL)); > + > + if (!success) { > + pr_err("%s failed.", __func__); > + return -EBUSY; Same here.