]> Git Repo - linux.git/commitdiff
tpm: ibmvtpm: Set TPM_OPS_AUTO_STARTUP flag on driver
authorStefan Berger <[email protected]>
Mon, 14 Oct 2024 14:16:43 +0000 (10:16 -0400)
committerJarkko Sakkinen <[email protected]>
Thu, 21 Nov 2024 22:48:26 +0000 (00:48 +0200)
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 <[email protected]>
Reviewed-by: Jarkko Sakkinen <[email protected]>
Signed-off-by: Jarkko Sakkinen <[email protected]>
drivers/char/tpm/tpm2-sessions.c
drivers/char/tpm/tpm_ibmvtpm.c

index b0f13c8ea79c7a95fb3315cb5f5f6729feb90445..b70165b588eccd9ec2f72bc2429cb97d6a691c83 100644 (file)
@@ -1390,5 +1390,4 @@ int tpm2_sessions_init(struct tpm_chip *chip)
 
        return rc;
 }
-EXPORT_SYMBOL(tpm2_sessions_init);
 #endif /* CONFIG_TCG_TPM2_HMAC */
index 1e5b107d1f3bdb621e12c425799b3ebf7d9b4388..76d048f63d55b57646c4a910ca15b05c7df64c75 100644 (file)
@@ -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 {
This page took 0.05944 seconds and 4 git commands to generate.