Received: by 2002:a05:7412:40d:b0:e2:908c:2ebd with SMTP id 13csp905994rdf; Tue, 21 Nov 2023 23:11:23 -0800 (PST) X-Google-Smtp-Source: AGHT+IF099fqd3Y6qNJRs9+OWuo3aNc4LPNQjKR+5uewVRUwYTvJx+C0CbWrQtQeLWQDcpYW5V5+ X-Received: by 2002:a05:6a00:1d8f:b0:6cb:440c:1f60 with SMTP id z15-20020a056a001d8f00b006cb440c1f60mr2480765pfw.13.1700637083007; Tue, 21 Nov 2023 23:11:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700637082; cv=none; d=google.com; s=arc-20160816; b=uCzHV7P8j0qe3/qoM14bGWQK/FITMFwOExphb5F4KGZUG98ckk0CB+bYhPZ8YBkCKD jE1oiXhUH/fajTSRuzY53AlS4yxdShzIkqtbCSrkOUnv++rkHw0OYa0WMCb0qq+XtyK0 /ZhhP0jTzfdZWdaHgnMhzhhaE/R/+elwTvbTtZ+N7lQIxtpwO2AQDo3RCCO8tfOQY83F zUNHG0jEH5Pk2oS9rGVOnmxKORVbW3Bu61HTFbFL1ynHXhEghN/WxHBbhSQgHxrO4CVD zHpF4Db0STU1C7WE4qaaiVCHt6xH9rQV7R6Z3qLvbK+X6gyUcedsOWtvQvCIRnQVbZq8 QXUg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id; bh=jotYtvMSUGDFBI/G93urrloXFjZ3yPqYz88um8c1L2s=; fh=J9d/FDTvOX/Hptki5MvFFZp596sxm2nYIktqoB9AsNw=; b=n82D1Hg9xV1jqGWP5+mpxVpH7L5BTzbSOqNxlsUGlBhaQn8oOTcETZqGAaSDxfpZCd 0pC4xF6xDzOtcNH0bbU/tIUEOgfVGHwDQ7CJffLJK1Mce9AIWO6F5Trz5JeawPXX+bRn QueifpUiY14HHoJhSONkQLn3cLr2FHb2qDBiT17yWSL3UTR+JeyuR7R0yl6LiumVX0Md cYmjLhNAFOY/JWI8Sw11qbG0mWfsbyY12wnqexcGRTmrcDR1n7y6bpKnElzdX1snXLwr 7hc9+657nQJ3pzUf/FKlBhQ3BTmHIee3C5CwUu99iI4hAmi+ScB/IeuXv5ScY3ZB76mP hNSw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from fry.vger.email (fry.vger.email. [23.128.96.38]) by mx.google.com with ESMTPS id w31-20020a63491f000000b005c219456791si10141335pga.322.2023.11.21.23.11.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Nov 2023 23:11:22 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) client-ip=23.128.96.38; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 8AEEF80FE2A0; Tue, 21 Nov 2023 23:11:20 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234891AbjKVHLI (ORCPT + 99 others); Wed, 22 Nov 2023 02:11:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41268 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234878AbjKVHLF (ORCPT ); Wed, 22 Nov 2023 02:11:05 -0500 Received: from mx3.molgen.mpg.de (mx3.molgen.mpg.de [141.14.17.11]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6D2FD1A4; Tue, 21 Nov 2023 23:11:00 -0800 (PST) Received: from [10.0.3.168] (unknown [93.240.169.83]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: pmenzel) by mx.molgen.mpg.de (Postfix) with ESMTPSA id 2625861E5FE01; Wed, 22 Nov 2023 08:10:35 +0100 (CET) Message-ID: Date: Wed, 22 Nov 2023 08:10:34 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] tpm: Start the tpm2 before running a self test. To: Hermin Anggawijaya Cc: peterhuewe@gmx.de, jarkko@kernel.org, jgg@ziepe.ca, linux-integrity@vger.kernel.org, linux-kernel@vger.kernel.org References: <20231122065528.1049819-1-hermin.anggawijaya@alliedtelesis.co.nz> Content-Language: en-US From: Paul Menzel In-Reply-To: <20231122065528.1049819-1-hermin.anggawijaya@alliedtelesis.co.nz> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Tue, 21 Nov 2023 23:11:20 -0800 (PST) Dear Hermin, Thank you for your patch. It’d be great if you removed the dot/period from the end of the commit message summary/title. Am 22.11.23 um 07:55 schrieb Hermin Anggawijaya: > Before sending a command to attempt the self test, the TPM > may need to be started, otherwise the self test returns > TPM2_RC_INITIALIZE value causing a log as follows: > "tpm tpm0: A TPM error (256) occurred attempting the self test". Please document on what platform this happens. > Signed-off-by: Hermin Anggawijaya > --- > drivers/char/tpm/tpm2-cmd.c | 8 ++++---- > 1 file changed, 4 insertions(+), 4 deletions(-) > > diff --git a/drivers/char/tpm/tpm2-cmd.c b/drivers/char/tpm/tpm2-cmd.c > index 93545be190a5..0530f3b5f86a 100644 > --- a/drivers/char/tpm/tpm2-cmd.c > +++ b/drivers/char/tpm/tpm2-cmd.c > @@ -737,15 +737,15 @@ int tpm2_auto_startup(struct tpm_chip *chip) > if (rc) > goto out; > > + rc = tpm2_startup(chip); > + if (rc && rc != TPM2_RC_INITIALIZE) > + goto out; > + > rc = tpm2_do_selftest(chip); > if (rc && rc != TPM2_RC_INITIALIZE) > goto out; > > if (rc == TPM2_RC_INITIALIZE) { > - rc = tpm2_startup(chip); > - if (rc) > - goto out; > - > rc = tpm2_do_selftest(chip); > if (rc) > goto out; Kind regards, Paul