Message ID | 20200227002654.7536-5-stefanb@linux.vnet.ibm.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | Enable vTPM 2.0 for the IBM vTPM driver | expand |
On Wed, Feb 26, 2020 at 07:26:54PM -0500, Stefan Berger wrote: > From: Stefan Berger <stefanb@linux.ibm.com> > > Support TPM 2 in the IBM vTPM driver. The hypervisor tells us what > version of TPM is connected through the vio_device_id. > > In case a TPM 2 is found, we set the TPM_CHIP_FLAG_TPM2 flag. > > Signed-off-by: Stefan Berger <stefanb@linux.ibm.com> The commit message does not have anything on "vtpm20". /Jarkko
diff --git a/drivers/char/tpm/tpm_ibmvtpm.c b/drivers/char/tpm/tpm_ibmvtpm.c index eee566eddb35..0df815f9a6c5 100644 --- a/drivers/char/tpm/tpm_ibmvtpm.c +++ b/drivers/char/tpm/tpm_ibmvtpm.c @@ -29,6 +29,7 @@ static const char tpm_ibmvtpm_driver_name[] = "tpm_ibmvtpm"; static const struct vio_device_id tpm_ibmvtpm_device_table[] = { { "IBM,vtpm", "IBM,vtpm"}, + { "IBM,vtpm", "IBM,vtpm20"}, { "", "" } }; MODULE_DEVICE_TABLE(vio, tpm_ibmvtpm_device_table); @@ -672,6 +673,9 @@ static int tpm_ibmvtpm_probe(struct vio_dev *vio_dev, if (rc) goto init_irq_cleanup; + if (!strcmp(id->compat, "IBM,vtpm20")) + chip->flags |= TPM_CHIP_FLAG_TPM2; + if (!wait_event_timeout(ibmvtpm->crq_queue.wq, ibmvtpm->rtce_buf != NULL, HZ)) {