tpm: add request_locality before write TPM_INT_ENABLE
Subsystems (2)
PATCH v2 1/1 tpm: add request_locality before write TPM_INT_ENABLE
Locality is not appropriately requested before writing the int mask. Add the missing boilerplate.
---
v2: rewrite the commit message.
drivers/char/tpm/tpm_tis_core.c | 8 ++++++++ 1 file changed, 8 insertions(+)
drivers/char/tpm/tpm_tis_core.c +8 -0
@@ -978,7 +978,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)
Signature · 1 line
2.17.1
Quoted 27 lines · Chen Jun
Locality is not appropriately requested before writing the int mask. Add the missing boilerplate.
Fixes e6aef069b6e9 ("tpm_tis: convert to using locality callbacks")Signed-off-by Chen Jun <[email protected]>---
v2: rewrite the commit message.
drivers/char/tpm/tpm_tis_core.c | 8 ++++++++
1 file changed, 8 insertions(+)drivers/char/tpm/tpm_tis_core.c +0
-0@@ -978,7 +978,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;drivers/char/tpm/tpm_tis_core.c +7
-0+ + rc = request_locality(chip, 0); + if (rc < 0) { + rc = -ENODEV; + goto out_err; + } +
Quoted 5 lines
tpm_tis_write32(priv,
TPM_INT_ENABLE(priv->locality), intmask); + release_locality(chip, 0);
rc =tpm_chip_start(chip);
if (rc)
Thank you.
/Jarkko
Quoted 5 lines · Chen Jun
Locality is not appropriately requested before writing the int mask. Add the missing boilerplate.
Fixes e6aef069b6e9 ("tpm_tis: convert to using locality callbacks")Signed-off-by Chen Jun <[email protected]>
I'll queue this to v5.16-rc2 pull request (already closed for rc1).
/Jarkko