tpm: remove TPM_TRANSMIT_UNLOCKED flag
Added locking as part of tpm_try_get_ops() and tpm_put_ops() as they are anyway used in most of the call sites except in tpmrm_release() where we take the locks manually. Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com> Reviewed-by: Stefan Berger <stefanb@linux.ibm.com> Tested-by: Stefan Berger <stefanb@linux.ibm.com> Reviewed-by: Jerry Snitselaar <jsnitsel@redhat.com> Reviewed-by: James Bottomley <James.Bottomley@HansenPartnership.com> Tested-by: Alexander Steffen <Alexander.Steffen@infineon.com>
This commit is contained in:
@@ -236,10 +236,6 @@ ssize_t tpm_transmit(struct tpm_chip *chip, u8 *buf, size_t bufsiz,
|
||||
memcpy(save, buf, save_size);
|
||||
|
||||
for (;;) {
|
||||
if (!(flags & TPM_TRANSMIT_UNLOCKED) &&
|
||||
!(flags & TPM_TRANSMIT_NESTED))
|
||||
mutex_lock(&chip->tpm_mutex);
|
||||
|
||||
if (chip->ops->clk_enable != NULL)
|
||||
chip->ops->clk_enable(chip, true);
|
||||
|
||||
@@ -266,10 +262,6 @@ out_locality:
|
||||
if (chip->ops->clk_enable != NULL)
|
||||
chip->ops->clk_enable(chip, false);
|
||||
|
||||
if (!(flags & TPM_TRANSMIT_UNLOCKED) &&
|
||||
!(flags & TPM_TRANSMIT_NESTED))
|
||||
mutex_unlock(&chip->tpm_mutex);
|
||||
|
||||
if (ret < 0)
|
||||
break;
|
||||
rc = be32_to_cpu(header->return_code);
|
||||
|
مرجع در شماره جدید
Block a user