UPSTREAM: 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: I91866a30fca8c9efae15a900722eb0fc3bebbfc3
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Original-Commit-Id: 5cf1fadeca
Original-Change-Id: I2c5200085eb357259edab39c1a0fa7b1d81ba7b2
Original-Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Original-Reviewed-on: https://review.coreboot.org/19056
Original-Tested-by: build bot (Jenkins)
Original-Reviewed-by: Furquan Shaikh <furquan@google.com>
Reviewed-on: https://chromium-review.googlesource.com/466051
This commit is contained in:
Aaron Durbin 2017-03-27 17:25:06 -05:00 committed by chrome-bot
commit fc257c0970

View file

@ -212,6 +212,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);