Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 13af3a9b authored by Chen Jun's avatar Chen Jun Committed by Greg Kroah-Hartman
Browse files

tpm: add request_locality before write TPM_INT_ENABLE



[ Upstream commit 0ef333f5ba7f24f5d8478425c163d3097f1c7afd ]

Locality is not appropriately requested before writing the int mask.
Add the missing boilerplate.

Fixes: e6aef069 ("tpm_tis: convert to using locality callbacks")
Signed-off-by: default avatarChen Jun <chenjun102@huawei.com>
Reviewed-by: default avatarJarkko Sakkinen <jarkko@kernel.org>
Signed-off-by: default avatarJarkko Sakkinen <jarkko@kernel.org>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 5d5223be
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -877,7 +877,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)