diff options
author | Chen Jun <chenjun102@huawei.com> | 2021-10-13 09:25:56 +0300 |
---|---|---|
committer | Joel Stanley <joel@jms.id.au> | 2022-01-14 06:48:50 +0300 |
commit | f83801233166357e9df5bd5156db2739b5c8fd5e (patch) | |
tree | 86b4e6b2e09d53bb4d4c11e5bf198865fe17588a /drivers/char | |
parent | 41b9e8a63b58ba9f0be7007405fb528c6fd38d54 (diff) | |
download | linux-f83801233166357e9df5bd5156db2739b5c8fd5e.tar.xz |
tpm: add request_locality before write TPM_INT_ENABLE
Locality is not appropriately requested before writing the int mask.
Add the missing boilerplate.
OpenBMC-Staging-Count: 1
Fixes: e6aef069b6e9 ("tpm_tis: convert to using locality callbacks")
Signed-off-by: Chen Jun <chenjun102@huawei.com>
Reviewed-by: Jarkko Sakkinen <jarkko@kernel.org>
Signed-off-by: Jarkko Sakkinen <jarkko@kernel.org>
Signed-off-by: Joel Stanley <joel@jms.id.au>
Diffstat (limited to 'drivers/char')
-rw-r--r-- | drivers/char/tpm/tpm_tis_core.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/char/tpm/tpm_tis_core.c b/drivers/char/tpm/tpm_tis_core.c index b2659a4c4016..e2df1098a812 100644 --- a/drivers/char/tpm/tpm_tis_core.c +++ b/drivers/char/tpm/tpm_tis_core.c @@ -994,7 +994,15 @@ int tpm_tis_core_init(struct device *dev, struct tpm_tis_data *priv, int irq, intmask |= TPM_INTF_CMD_READY_INT | TPM_INTF_LOCALITY_CHANGE_INT | TPM_INTF_DATA_AVAIL_INT | TPM_INTF_STS_VALID_INT; intmask &= ~TPM_GLOBAL_INT_ENABLE; + + rc = request_locality(chip, 0); + if (rc < 0) { + rc = -ENODEV; + goto out_err; + } + tpm_tis_write32(priv, TPM_INT_ENABLE(priv->locality), intmask); + release_locality(chip, 0); rc = tpm_chip_start(chip); if (rc) |