[Skiboot] [PATCH 2/4] tpm_i2c_interface: set timeout before each request
Claudio Carvalho
cclaudio at linux.vnet.ibm.com
Thu Nov 24 14:18:40 AEDT 2016
Tested-by: Claudio Carvalho <cclaudio at linux.vnet.ibm.com>
On 11/23/2016 03:46 AM, Stewart Smith wrote:
> 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 {
>
More information about the Skiboot
mailing list