summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAaron Durbin <adurbin@chromium.org>2017-03-27 17:25:06 -0500
committerAaron Durbin <adurbin@chromium.org>2017-04-03 05:31:53 +0200
commit5cf1fadeca706f8d3016ea44c3e482c2428d6b3f (patch)
tree636f447682afa614186452ee8b21f71bd7f65b75
parent45a0dbc95c1ef1d697598655a526709f27151bb4 (diff)
drivers/spi/tpm: de-assert chip select on transaction error
In the case of start_transaction() failing the chip select is never deasserted. Correct that by deasserting the chip select when start_transaction() fails. BUG=b:36598499 Change-Id: I2c5200085eb357259edab39c1a0fa7b1d81ba7b2 Signed-off-by: Aaron Durbin <adurbin@chromium.org> Reviewed-on: https://review.coreboot.org/19056 Tested-by: build bot (Jenkins) Reviewed-by: Furquan Shaikh <furquan@google.com>
-rw-r--r--src/drivers/spi/tpm/tpm.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/drivers/spi/tpm/tpm.c b/src/drivers/spi/tpm/tpm.c
index b2bda8c928..e3faff09d1 100644
--- a/src/drivers/spi/tpm/tpm.c
+++ b/src/drivers/spi/tpm/tpm.c
@@ -171,6 +171,7 @@ static int start_transaction(int read_write, size_t bytes, unsigned addr)
do {
if (stopwatch_expired(&sw)) {
printk(BIOS_ERR, "TPM flow control failure\n");
+ tpm_if.cs_deassert(&tpm_if.slave);
return 0;
}
tpm_if.xfer(&tpm_if.slave, NULL, 0, &byte, 1);