diff options
author | Stewart Smith <stewart@linux.vnet.ibm.com> | 2016-11-23 16:46:00 +1100 |
---|---|---|
committer | Stewart Smith <stewart@linux.vnet.ibm.com> | 2016-11-24 16:47:16 +1100 |
commit | dab67b5d19b0e004249d5a850e283823a0e60d40 (patch) | |
tree | d636aa56d4064c5fc1323ba675635b0836003b51 /libstb | |
parent | 441ddb9b4719a092bbbf81fcf775632f282a3fca (diff) | |
download | skiboot-dab67b5d19b0e004249d5a850e283823a0e60d40.zip skiboot-dab67b5d19b0e004249d5a850e283823a0e60d40.tar.gz skiboot-dab67b5d19b0e004249d5a850e283823a0e60d40.tar.bz2 |
tpm_i2c_interface: set timeout before each request
The i2c code manipulates req->timeout, so it has to be reset before
re-sending.
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Tested-by: Claudio Carvalho <cclaudio@linux.vnet.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'libstb')
-rw-r--r-- | libstb/drivers/tpm_i2c_interface.c | 2 |
1 files changed, 1 insertions, 1 deletions
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 { |