Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp4993126rwb; Sun, 4 Dec 2022 12:09:27 -0800 (PST) X-Google-Smtp-Source: AA0mqf5/DOwDcrBd1xyau+HqtoFwX9ZTp+QB927Itz4l9otcMYweTClZDJhskkXrqF+b7YXlvlCf X-Received: by 2002:a17:902:ab44:b0:186:acb0:e93c with SMTP id ij4-20020a170902ab4400b00186acb0e93cmr60960520plb.141.1670184566871; Sun, 04 Dec 2022 12:09:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670184566; cv=none; d=google.com; s=arc-20160816; b=LS78DU7D+DpWyY1K5Q5VX4N0Wy5YPBJxUbK0xFbdj9EdafvaMURUAZO02dVNsy+kRH XKjJJUO2mX7OewTYE7OuRqnpofmiRAIcgpp7lauKczOc0XaGUoxE1/e+4WnuxxyC8HQZ ctAUUh8icC2wWHQA5JCxyKQqJuU8Ke5rwAhIGqgaS2SzFkvNb8WQPM2XKitln/XnsamS eSHMccbK/NpsOgXSS/vwowVT2zcmuGhGCZJO/KfvECQ8eEQHFqwQhKPdK8qckd9CvykL jW3KRDEn51rSo68uo81jhGuSSxEWYWaCs+yaUk+s0KvV7IcCrCRro/QlhjwuWQNMKKsQ N6bw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=5cuam3iPBFHHS3d3WwDHrd5l00plXpuuVkSI1Obzmr8=; b=UUWAxd22Di1FspSlIfsCvWzkWpHGL/HFnKiUixDBQf4L4PiFiLlEh1L4qUWW42t0Fm n1NxoCt0ZgmKjF95cYuE2asxOcGmjciT6giRXBCjyhlL5HBf89PY7cSztU1/55+QxgQH lxxkmyZTAb8RfCaKEixnHSj7oAFeK0gkNnz5fn9tElXAuioG7zN41PKwW2MjJebNG3I/ adt5knrs9AgAQHqb2RsUywnFTCFrUv7boDKJSjmHPHIIFeuH8QDjmpME3WB4EaeolZQn QjXt3H8DV8mnnmfrLUUE0NrErNPG0iQRtxvHpIm8lDbzAF19pnA5sjNG30WyOf1Bb4zj y5yg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=UZgQpnrp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u6-20020a170903124600b00178431e112asi14205405plh.449.2022.12.04.12.09.16; Sun, 04 Dec 2022 12:09:26 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=UZgQpnrp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230311AbiLDTvg (ORCPT + 82 others); Sun, 4 Dec 2022 14:51:36 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55182 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230038AbiLDTvf (ORCPT ); Sun, 4 Dec 2022 14:51:35 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4590A265F; Sun, 4 Dec 2022 11:51:34 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id DF738B80A3A; Sun, 4 Dec 2022 19:51:32 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1540AC433D6; Sun, 4 Dec 2022 19:51:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1670183491; bh=hTdz1ie8wXuQoGXLWJgWEqjpSdAF4fESB48f2OAu9A4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=UZgQpnrpB+aykkGkWdNhKKsbIc6R02AxZYu78Z7oGmr9GhBVuLIw3GaQJif815Np9 5MWuMPNehP/SyHW2D5NKlaNQlwdiqOiDTPC9T1/fE1R1o2OuhPLF99LD3KSFkHwFbZ nBsdl3jLn4Q/fFgKhh5P2c0WLv1qdNewd8IDrJtP1YvuMYbYCKRonSjy8Ple3D/e+r zWETYFiiIBzjicVsxqxEbWebrGB49GYFGSQ/Vp2MhNY/5uuc/z7haADNw3baE4jDVz zEtozoG+yA5294XA5PMK1lM38GnRnFYt0/NMMhSZwTmfKKf727RFCMfwdtQ9jSyR4b qkU6jl2EX4b8Q== Date: Sun, 4 Dec 2022 19:51:20 +0000 From: Jarkko Sakkinen To: "Michael Kelley (LINUX)" Cc: "peterhuewe@gmx.de" , "jgg@ziepe.ca" , "tomas.winkler@intel.com" , "linux-integrity@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH 1/1] tpm/tpm_crb: Fix error message in __crb_relinquish_locality() Message-ID: References: <1668195533-16761-1-git-send-email-mikelley@microsoft.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Nov 29, 2022 at 04:34:09AM +0000, Michael Kelley (LINUX) wrote: > From: Jarkko Sakkinen Sent: Sunday, November 27, 2022 8:39 AM > > > > On Fri, Nov 11, 2022 at 11:38:53AM -0800, Michael Kelley wrote: > > > The error message in __crb_relinquish_locality() mentions requestAccess > > > instead of Relinquish. Fix it. > > > > > > Fixes: 888d867df441 ("tpm: cmd_ready command can be issued only after granting locality") > > > Signed-off-by: Michael Kelley > > > --- > > > drivers/char/tpm/tpm_crb.c | 2 +- > > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > > > diff --git a/drivers/char/tpm/tpm_crb.c b/drivers/char/tpm/tpm_crb.c > > > index 1860665..65f8f17 100644 > > > --- a/drivers/char/tpm/tpm_crb.c > > > +++ b/drivers/char/tpm/tpm_crb.c > > > @@ -252,7 +252,7 @@ static int __crb_relinquish_locality(struct device *dev, > > > iowrite32(CRB_LOC_CTRL_RELINQUISH, &priv->regs_h->loc_ctrl); > > > if (!crb_wait_for_reg_32(&priv->regs_h->loc_state, mask, value, > > > TPM2_TIMEOUT_C)) { > > > - dev_warn(dev, "TPM_LOC_STATE_x.requestAccess timed out\n"); > > > + dev_warn(dev, "TPM_LOC_STATE_x.Relinquish timed out\n"); > > > return -ETIME; > > > } > > > > > > -- > > > 1.8.3.1 > > > > > > > Please explain. > > > > There are two parallel functions: __crb_request_locality() and > __crb_relinquish_locality(). In the current code, both return the > same text in the error message if a timeout occurs. That > error message seems appropriate for __crb_request_locality() > since it is setting the "requestAccess" bit. > > But the error message seems inappropriate for > __crb_relinquish_locality(), which is setting the "Relinquish" bit. > So the patch changes the error message to indicate that the > timeout occurred in setting the Relinquish bit. > > I'm looking at Section 6.5.3.2.2.1 in the TCG PC Client Platform > TPM Profile Specification for TPM 2.0, Version 1.05 Revision 14. > This is where the "requestAccess" and "Relinquish" bits are defined. > > Or maybe I am not understanding what you are getting at with > "Please explain." I misread the callback name, when I first looked into this (in too much rush). You're absolutely correct. Reviewed-by: Jarkko Sakkinen BR, Jarkko