Skip to content

Commit

Permalink
tpm_i2c_interface: set timeout before each request
Browse files Browse the repository at this point in the history
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>
(cherry picked from commit dab67b5)
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
  • Loading branch information
stewartsmith committed Nov 24, 2016
1 parent 34ec1b5 commit 85a372c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libstb/drivers/tpm_i2c_interface.c
Expand Up @@ -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 {
Expand Down

0 comments on commit 85a372c

Please sign in to comment.