mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-25 13:14:07 +08:00
tpm: turn on TPM on suspend for TPM 1.x
tpm_chip_start/stop() should be also called for TPM 1.x devices on
suspend. Add that functionality back. Do not lock the chip because
it is unnecessary as there are no multiple threads using it when
doing the suspend.
Fixes: a3fbfae82b
("tpm: take TPM chip power gating out of tpm_transmit()")
Reported-by: Paul Zimmerman <pauldzim@gmail.com>
Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Tested-by: Domenico Andreoli <domenico.andreoli@linux.com>
Signed-off-by: James Morris <james.morris@microsoft.com>
This commit is contained in:
parent
fd008d1a7a
commit
e891db1a18
@ -402,15 +402,13 @@ int tpm_pm_suspend(struct device *dev)
|
|||||||
if (chip->flags & TPM_CHIP_FLAG_ALWAYS_POWERED)
|
if (chip->flags & TPM_CHIP_FLAG_ALWAYS_POWERED)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
if (chip->flags & TPM_CHIP_FLAG_TPM2) {
|
if (!tpm_chip_start(chip)) {
|
||||||
mutex_lock(&chip->tpm_mutex);
|
if (chip->flags & TPM_CHIP_FLAG_TPM2)
|
||||||
if (!tpm_chip_start(chip)) {
|
|
||||||
tpm2_shutdown(chip, TPM2_SU_STATE);
|
tpm2_shutdown(chip, TPM2_SU_STATE);
|
||||||
tpm_chip_stop(chip);
|
else
|
||||||
}
|
rc = tpm1_pm_suspend(chip, tpm_suspend_pcr);
|
||||||
mutex_unlock(&chip->tpm_mutex);
|
|
||||||
} else {
|
tpm_chip_stop(chip);
|
||||||
rc = tpm1_pm_suspend(chip, tpm_suspend_pcr);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return rc;
|
return rc;
|
||||||
|
Loading…
Reference in New Issue
Block a user