[RFC][PATCH 6/9] tpm_tis_spi: fix sending wrong data during wait state handling

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



When the TPM signals wait states, the driver has to repeat the last byte
until the TPM stops signaling wait states and accepts that byte. It should
not send a dummy byte, even though that might work with some TPM
implementations.

Signed-off-by: Alexander Steffen <Alexander.Steffen@xxxxxxxxxxxx>
---
 drivers/char/tpm/tpm_tis_spi.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/char/tpm/tpm_tis_spi.c b/drivers/char/tpm/tpm_tis_spi.c
index c4f511b..2758b41 100644
--- a/drivers/char/tpm/tpm_tis_spi.c
+++ b/drivers/char/tpm/tpm_tis_spi.c
@@ -88,9 +88,8 @@ static int tpm_tis_spi_transfer(struct tpm_tis_data *data, u32 addr, u16 len,
 
 		if ((phy->iobuf[3] & 0x01) == 0) {
 			// handle SPI wait states
-			phy->iobuf[0] = 0;
-
 			for (i = 0; i < TPM_RETRY; i++) {
+				phy->iobuf[0] = addr;
 				spi_xfer.len = 1;
 				spi_message_init(&m);
 				spi_message_add_tail(&spi_xfer, &m);
-- 
2.7.4




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux Kernel]     [Linux Kernel Hardening]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux SCSI]

  Powered by Linux