Thread (3 messages) 3 messages, 3 authors, 2017-02-24

Re: [PATCH 2/5] tpm_tis_spi: Abort transfer when too many wait states are signaled

From: Christophe Ricard <hidden>
Date: 2017-02-17 05:04:45
Also in: lkml

Nitpick: Are you sure this patch is necessary having #3 on top of it ?

On 16/02/2017 08:08, Peter Huewe wrote:
quoted hunk ↗ jump to hunk
Abort the transfer with ETIMEDOUT when the TPM signals more than
TPM_RETRY wait states. Continuing with the transfer in this state
will only lead to arbitrary failures in other parts of the code.

Cc: <redacted>
Fixes: 0edbfea537d1 ("tpm/tpm_tis_spi: Add support for spi phy")
Signed-off-by: Alexander Steffen <redacted>
Signed-off-by: Peter Huewe <redacted>
---
  drivers/char/tpm/tpm_tis_spi.c | 5 +++++
  1 file changed, 5 insertions(+)
diff --git a/drivers/char/tpm/tpm_tis_spi.c b/drivers/char/tpm/tpm_tis_spi.c
index 6e1a3c43f621..d782b9974c14 100644
--- a/drivers/char/tpm/tpm_tis_spi.c
+++ b/drivers/char/tpm/tpm_tis_spi.c
@@ -101,6 +101,11 @@ static int tpm_tis_spi_transfer(struct tpm_tis_data *data, u32 addr, u8 len,
  			goto exit;
  	}
  
+	if (i == TPM_RETRY) {
+		ret = -ETIMEDOUT;
+		goto exit;
+	}
+
  	spi_xfer.cs_change = 0;
  	spi_xfer.len = len;
  
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help