tpm_tis: reserve chip for duration of tpm_tis_core_init
authorJerry Snitselaar <jsnitsel@redhat.com>
Wed, 11 Dec 2019 23:54:55 +0000 (16:54 -0700)
committerJarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Tue, 17 Dec 2019 00:57:33 +0000 (02:57 +0200)
commit21df4a8b6018b842d4db181a8b24166006bad3cd
tree7f6195ba6f6603ddcfc8cca3b42a95a12f9e1300
parentbea37414453eb08d4ceffeb60a9d490dbc930cea
tpm_tis: reserve chip for duration of tpm_tis_core_init

Instead of repeatedly calling tpm_chip_start/tpm_chip_stop when
issuing commands to the tpm during initialization, just reserve the
chip after wait_startup, and release it when we are ready to call
tpm_chip_register.

Cc: Christian Bundy <christianbundy@fraction.io>
Cc: Dan Williams <dan.j.williams@intel.com>
Cc: Peter Huewe <peterhuewe@gmx.de>
Cc: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Cc: Jason Gunthorpe <jgg@ziepe.ca>
Cc: Stefan Berger <stefanb@linux.vnet.ibm.com>
Cc: stable@vger.kernel.org
Cc: linux-integrity@vger.kernel.org
Fixes: a3fbfae82b4c ("tpm: take TPM chip power gating out of tpm_transmit()")
Fixes: 5b359c7c4372 ("tpm_tis_core: Turn on the TPM before probing IRQ's")
Suggested-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Reviewed-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Signed-off-by: Jerry Snitselaar <jsnitsel@redhat.com>
Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
drivers/char/tpm/tpm_tis_core.c