From: "Jarkko Sakkinen" <jarkko@kernel.org>
To: "Stefan Berger" <stefanb@linux.ibm.com>,
<linux-integrity@vger.kernel.org>,
<linuxppc-dev@lists.ozlabs.org>
Cc: <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] tpm: ibmvtpm: Set TPM_OPS_AUTO_STARTUP flag on driver
Date: Wed, 16 Oct 2024 00:15:39 +0300 [thread overview]
Message-ID: <D4WOWALWYOES.Q12TQS9P30TH@kernel.org> (raw)
In-Reply-To: <20241014141643.3101129-1-stefanb@linux.ibm.com>
On Mon Oct 14, 2024 at 5:16 PM EEST, Stefan Berger wrote:
> Set the TPM_OPS_AUTO_STARTUP on the driver so that the ibmvtpm driver now
> uses tpm2_auto_startup and tpm1_auto_startup like many other drivers do.
> Remove tpm_get_timeouts, tpm2_get_cc_attrs_tbl, and tpm2_sessions_init
> calls from it since these will all be called in tpm2_auto_startup and
> tpm1_auto_startup.
>
> The exporting of the tpm2_session_init symbol was only necessary while the
> ibmvtpm driver was calling this function. Since this is not the case
> anymore, remove this symbol from being exported.
>
> What is new for the ibmvtpm driver is that now tpm2_do_selftest and
> tpm1_do_selftest will be called that send commands to the TPM to perform
> or continue its selftest. However, the firmware should already have sent
> these commands so that the TPM will not do much work at this time.
>
> Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
> ---
> drivers/char/tpm/tpm2-sessions.c | 1 -
> drivers/char/tpm/tpm_ibmvtpm.c | 15 +--------------
> 2 files changed, 1 insertion(+), 15 deletions(-)
>
> diff --git a/drivers/char/tpm/tpm2-sessions.c b/drivers/char/tpm/tpm2-sessions.c
> index 511c67061728..b1a0a37f14d7 100644
> --- a/drivers/char/tpm/tpm2-sessions.c
> +++ b/drivers/char/tpm/tpm2-sessions.c
> @@ -1362,5 +1362,4 @@ int tpm2_sessions_init(struct tpm_chip *chip)
>
> return rc;
> }
> -EXPORT_SYMBOL(tpm2_sessions_init);
> #endif /* CONFIG_TCG_TPM2_HMAC */
> diff --git a/drivers/char/tpm/tpm_ibmvtpm.c b/drivers/char/tpm/tpm_ibmvtpm.c
> index 1e5b107d1f3b..76d048f63d55 100644
> --- a/drivers/char/tpm/tpm_ibmvtpm.c
> +++ b/drivers/char/tpm/tpm_ibmvtpm.c
> @@ -450,6 +450,7 @@ static bool tpm_ibmvtpm_req_canceled(struct tpm_chip *chip, u8 status)
> }
>
> static const struct tpm_class_ops tpm_ibmvtpm = {
> + .flags = TPM_OPS_AUTO_STARTUP,
> .recv = tpm_ibmvtpm_recv,
> .send = tpm_ibmvtpm_send,
> .cancel = tpm_ibmvtpm_cancel,
> @@ -690,20 +691,6 @@ static int tpm_ibmvtpm_probe(struct vio_dev *vio_dev,
> if (!strcmp(id->compat, "IBM,vtpm20"))
> chip->flags |= TPM_CHIP_FLAG_TPM2;
>
> - rc = tpm_get_timeouts(chip);
> - if (rc)
> - goto init_irq_cleanup;
> -
> - if (chip->flags & TPM_CHIP_FLAG_TPM2) {
> - rc = tpm2_get_cc_attrs_tbl(chip);
> - if (rc)
> - goto init_irq_cleanup;
> -
> - rc = tpm2_sessions_init(chip);
> - if (rc)
> - goto init_irq_cleanup;
> - }
> -
> return tpm_chip_register(chip);
> init_irq_cleanup:
> do {
Not much to say about this ;-)
Reviewed-by: Jarkko Sakkinen <jarkko@kernel.org>
BR, Jarkko
next prev parent reply other threads:[~2024-10-15 21:15 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-14 14:16 [PATCH] tpm: ibmvtpm: Set TPM_OPS_AUTO_STARTUP flag on driver Stefan Berger
2024-10-15 21:15 ` Jarkko Sakkinen [this message]
2024-10-15 22:22 ` Jarkko Sakkinen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=D4WOWALWYOES.Q12TQS9P30TH@kernel.org \
--to=jarkko@kernel.org \
--cc=linux-integrity@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=stefanb@linux.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox