diff mbox series

[3/4] libstb/i2c-driver: Bump max timeout

Message ID 20180521012926.4365-3-oohall@gmail.com
State Accepted
Headers show
Series [1/4] p8-i2c: Allow a per-port default timeout | expand

Commit Message

Oliver O'Halloran May 21, 2018, 1:29 a.m. UTC
We have observed some TPMs clock streching the I2C bus for signifigant
amounts of time when processing commands. The same TPMs also have
errata that can result in permernantly locking up a bus in response to
an I2C transaction they don't understand. Using an excessively long
timeout to prevent this in the field.

Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
---
 libstb/drivers/tpm_i2c_interface.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/libstb/drivers/tpm_i2c_interface.c b/libstb/drivers/tpm_i2c_interface.c
index a6342e0c7e43..8e5ba3263cdc 100644
--- a/libstb/drivers/tpm_i2c_interface.c
+++ b/libstb/drivers/tpm_i2c_interface.c
@@ -21,7 +21,8 @@ 
 #include "tpm_i2c_interface.h"
 #include "../status_codes.h"
 
-#define I2C_BYTE_TIMEOUT_MS		30  /* 30ms/byte timeout */
+/* TPMs can clock strech I2C operations for a LOOOOOOONG */
+#define I2C_BYTE_TIMEOUT_MS		2000  /* 2000ms/byte timeout */
 
 /**
  * tpm_i2c_request_send - send request to i2c bus