From cc866c20c6f936f349d2f1773dd492dca9bbf0c1 Mon Sep 17 00:00:00 2001 From: Stefan Reinauer Date: Mon, 9 Sep 2013 10:47:52 -0700 Subject: [PATCH] TPM: Stop requesting/releasing the TPM locality. The locality is requested when the TPM is initialized and released when it's cleaned up. There's no reason to set it to the same thing again and restore it back to the same value before and after every transaction. BUG=None TEST=Built and booted on pit. BRANCH=None forward ported from https://chromium-review.googlesource.com/#/c/168400 Change-Id: I291d1f86f220ef0eff6809c6cb00459bf95aa5e0 Signed-off-by: Gabe Black Signed-off-by: Stefan Reinauer Reviewed-on: https://chromium-review.googlesource.com/168584 Reviewed-by: Gabe Black --- src/drivers/i2c/tpm/tpm_tis_i2c.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/drivers/i2c/tpm/tpm_tis_i2c.c b/src/drivers/i2c/tpm/tpm_tis_i2c.c index e700c3ab95..008fac6e8f 100644 --- a/src/drivers/i2c/tpm/tpm_tis_i2c.c +++ b/src/drivers/i2c/tpm/tpm_tis_i2c.c @@ -429,7 +429,6 @@ static int tpm_tis_i2c_recv(struct tpm_chip *chip, uint8_t *buf, size_t count) out: tpm_tis_i2c_ready(chip); - release_locality(chip, chip->vendor.locality, 0); return size; } @@ -444,9 +443,6 @@ static int tpm_tis_i2c_send(struct tpm_chip *chip, uint8_t *buf, size_t len) if (len > TPM_BUFSIZE) return -1; //E2BIG; /* command is too long for our tpm, sorry */ - if (request_locality(chip, 0) < 0) - return -1; //EBUSY; - status = tpm_tis_i2c_status(chip); if ((status & TPM_STS_COMMAND_READY) == 0) { tpm_tis_i2c_ready(chip); @@ -499,7 +495,6 @@ static int tpm_tis_i2c_send(struct tpm_chip *chip, uint8_t *buf, size_t len) return len; out_err: tpm_tis_i2c_ready(chip); - release_locality(chip, chip->vendor.locality, 0); return rc; }