diff options
author | Stefan Berger <stefanb@linux.ibm.com> | 2020-03-12 11:53:31 -0400 |
---|---|---|
committer | Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com> | 2020-03-15 20:12:52 +0200 |
commit | d8d74ea3c00214aee1e1826ca18e77944812b9b4 (patch) | |
tree | 9bc7320e48f530bba9f6311f049e8b4c4619b51d /drivers/char/tpm/tpm_ibmvtpm.h | |
parent | 5cb2ace90deb6df9c90172f904fb4a12ee4d443a (diff) |
tpm: ibmvtpm: Wait for buffer to be set before proceeding
Synchronize with the results from the CRQs before continuing with
the initialization. This avoids trying to send TPM commands while
the rtce buffer has not been allocated, yet.
This patch fixes an existing race condition that may occurr if the
hypervisor does not quickly respond to the VTPM_GET_RTCE_BUFFER_SIZE
request sent during initialization and therefore the ibmvtpm->rtce_buf
has not been allocated at the time the first TPM command is sent.
Fixes: 132f76294744 ("drivers/char/tpm: Add new device driver to support IBM vTPM")
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
Acked-by: Nayna Jain <nayna@linux.ibm.com>
Tested-by: Nayna Jain <nayna@linux.ibm.com>
Reviewed-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Diffstat (limited to 'drivers/char/tpm/tpm_ibmvtpm.h')
-rw-r--r-- | drivers/char/tpm/tpm_ibmvtpm.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/char/tpm/tpm_ibmvtpm.h b/drivers/char/tpm/tpm_ibmvtpm.h index 7983f1a33267..b92aa7d3e93e 100644 --- a/drivers/char/tpm/tpm_ibmvtpm.h +++ b/drivers/char/tpm/tpm_ibmvtpm.h @@ -26,6 +26,7 @@ struct ibmvtpm_crq_queue { struct ibmvtpm_crq *crq_addr; u32 index; u32 num_entry; + wait_queue_head_t wq; }; struct ibmvtpm_dev { |