[Skiboot] [PATCH 2/4] tpm_i2c_interface: set timeout before each request

Stewart Smith stewart at linux.vnet.ibm.com
Wed Nov 23 16:46:00 AEDT 2016


The i2c code manipulates req->timeout, so it has to be reset before
re-sending.

Signed-off-by: Stewart Smith <stewart at linux.vnet.ibm.com>
---
 libstb/drivers/tpm_i2c_interface.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libstb/drivers/tpm_i2c_interface.c b/libstb/drivers/tpm_i2c_interface.c
index 4d136fd..89f5ba6 100644
--- a/libstb/drivers/tpm_i2c_interface.c
+++ b/libstb/drivers/tpm_i2c_interface.c
@@ -99,11 +99,11 @@ int tpm_i2c_request_send(int tpm_bus_id, int tpm_dev_addr, int read_write,
 	 * since the I2C master's timeout is too short (1ms per byte).
 	 */
 	timeout = (buflen + offset_bytes + 2) * I2C_BYTE_TIMEOUT_MS;
-	i2c_set_req_timeout(req, timeout);
 
 	for (retries = 0; retries <= TPM_MAX_NACK_RETRIES; retries++) {
 		rc = 1;
 		waited = 0;
+		i2c_set_req_timeout(req, timeout);
 		i2c_queue_req(req);
 
 		do {
-- 
2.7.4



More information about the Skiboot mailing list