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

Oliver O'Halloran oohall at gmail.com
Mon May 21 11:29:25 AEST 2018


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 at gmail.com>
---
 libstb/drivers/tpm_i2c_interface.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

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
-- 
2.9.5



More information about the Skiboot mailing list