mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-21 18:11:39 +00:00
tpm, tpm_tis: Claim locality when interrupts are reenabled on resume
[ Upstream commit955df4f877
] In tpm_tis_resume() make sure that the locality has been claimed when tpm_tis_reenable_interrupts() is called. Otherwise the writings to the register might not have any effect. Fixes:45baa1d1fa
("tpm_tis: Re-enable interrupts upon (S3) resume") Signed-off-by: Lino Sanfilippo <l.sanfilippo@kunbus.com> Tested-by: Jarkko Sakkinen <jarkko@kernel.org> Reviewed-by: Jarkko Sakkinen <jarkko@kernel.org> Signed-off-by: Jarkko Sakkinen <jarkko@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
380f9f79b4
commit
fe2f093b05
1 changed files with 9 additions and 10 deletions
|
@ -1191,28 +1191,27 @@ int tpm_tis_resume(struct device *dev)
|
||||||
struct tpm_chip *chip = dev_get_drvdata(dev);
|
struct tpm_chip *chip = dev_get_drvdata(dev);
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
|
ret = tpm_tis_request_locality(chip, 0);
|
||||||
|
if (ret < 0)
|
||||||
|
return ret;
|
||||||
|
|
||||||
if (chip->flags & TPM_CHIP_FLAG_IRQ)
|
if (chip->flags & TPM_CHIP_FLAG_IRQ)
|
||||||
tpm_tis_reenable_interrupts(chip);
|
tpm_tis_reenable_interrupts(chip);
|
||||||
|
|
||||||
ret = tpm_pm_resume(dev);
|
ret = tpm_pm_resume(dev);
|
||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
goto out;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* TPM 1.2 requires self-test on resume. This function actually returns
|
* TPM 1.2 requires self-test on resume. This function actually returns
|
||||||
* an error code but for unknown reason it isn't handled.
|
* an error code but for unknown reason it isn't handled.
|
||||||
*/
|
*/
|
||||||
if (!(chip->flags & TPM_CHIP_FLAG_TPM2)) {
|
if (!(chip->flags & TPM_CHIP_FLAG_TPM2))
|
||||||
ret = tpm_tis_request_locality(chip, 0);
|
|
||||||
if (ret < 0)
|
|
||||||
return ret;
|
|
||||||
|
|
||||||
tpm1_do_selftest(chip);
|
tpm1_do_selftest(chip);
|
||||||
|
out:
|
||||||
tpm_tis_relinquish_locality(chip, 0);
|
tpm_tis_relinquish_locality(chip, 0);
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
return ret;
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL_GPL(tpm_tis_resume);
|
EXPORT_SYMBOL_GPL(tpm_tis_resume);
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in a new issue