Skip to content

Commit 02e9bda

Browse files
stefanbergerjarkkojs
authored andcommitted
tpm: ibmvtpm: Set TPM_OPS_AUTO_STARTUP flag on driver
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]>
1 parent 341d041 commit 02e9bda

File tree

2 files changed

+1
-15
lines changed

2 files changed

+1
-15
lines changed

drivers/char/tpm/tpm2-sessions.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1390,5 +1390,4 @@ int tpm2_sessions_init(struct tpm_chip *chip)
13901390

13911391
return rc;
13921392
}
1393-
EXPORT_SYMBOL(tpm2_sessions_init);
13941393
#endif /* CONFIG_TCG_TPM2_HMAC */

drivers/char/tpm/tpm_ibmvtpm.c

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -450,6 +450,7 @@ static bool tpm_ibmvtpm_req_canceled(struct tpm_chip *chip, u8 status)
450450
}
451451

452452
static const struct tpm_class_ops tpm_ibmvtpm = {
453+
.flags = TPM_OPS_AUTO_STARTUP,
453454
.recv = tpm_ibmvtpm_recv,
454455
.send = tpm_ibmvtpm_send,
455456
.cancel = tpm_ibmvtpm_cancel,
@@ -690,20 +691,6 @@ static int tpm_ibmvtpm_probe(struct vio_dev *vio_dev,
690691
if (!strcmp(id->compat, "IBM,vtpm20"))
691692
chip->flags |= TPM_CHIP_FLAG_TPM2;
692693

693-
rc = tpm_get_timeouts(chip);
694-
if (rc)
695-
goto init_irq_cleanup;
696-
697-
if (chip->flags & TPM_CHIP_FLAG_TPM2) {
698-
rc = tpm2_get_cc_attrs_tbl(chip);
699-
if (rc)
700-
goto init_irq_cleanup;
701-
702-
rc = tpm2_sessions_init(chip);
703-
if (rc)
704-
goto init_irq_cleanup;
705-
}
706-
707694
return tpm_chip_register(chip);
708695
init_irq_cleanup:
709696
do {

0 commit comments

Comments
 (0)