mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Nayna Jain <nayna@linux.vnet.ibm.com>
To: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Cc: linux-integrity@vger.kernel.org, zohar@linux.vnet.ibm.com,
	linux-security-module@vger.kernel.org,
	linux-kernel@vger.kernel.org, peterhuewe@gmx.de,
	tpmdd@selhorst.net, jgunthorpe@obsidianresearch.com
Subject: Re: [PATCH] tpm: moves the delay_msec increment after sleep in tpm_transmit()
Date: Fri, 6 Apr 2018 14:03:37 +0530	[thread overview]
Message-ID: <95af65a1-e618-5cdf-fb81-56434f1aa973@linux.vnet.ibm.com> (raw)
In-Reply-To: <20180405101210.GA21636@linux.intel.com>



On 04/05/2018 03:42 PM, Jarkko Sakkinen wrote:
> On Mon, Apr 02, 2018 at 09:50:06PM +0530, Nayna Jain wrote:
>> Commit e2fb992d82c6 ("tpm: add retry logic") introduced a new loop to
>> handle the TPM2_RC_RETRY error. The loop retries the command after
>> sleeping for the specified time, which is incremented exponentially in
>> every iteration. This patch fixes the initial sleep to be the default
>> sleep time.
> I think I understand the code change but do not understand what the
> long description.

It tells that the first sleep is delay_msec * 2 and not delay_msec.

>
>> Fixes: commit e2fb992d82c6 ("tpm: add retry logic")
>> Signed-off-by: Nayna Jain <nayna@linux.vnet.ibm.com>
>> Reviewed-by: Mimi Zohar <zohar@linux.vnet.ibm.com>
>> ---
>>   drivers/char/tpm/tpm-interface.c | 3 ++-
>>   1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/char/tpm/tpm-interface.c b/drivers/char/tpm/tpm-interface.c
>> index c43a9e28995e..6201aab374e6 100644
>> --- a/drivers/char/tpm/tpm-interface.c
>> +++ b/drivers/char/tpm/tpm-interface.c
>> @@ -587,7 +587,7 @@ ssize_t tpm_transmit(struct tpm_chip *chip, struct tpm_space *space,
>>   		 */
>>   		if (rc == TPM2_RC_TESTING && cc == TPM2_CC_SELF_TEST)
>>   			break;
>> -		delay_msec *= 2;
>> +
> Extra whitespace

I left just for clarity, but if not needed then I can remove it.

Thanks & Regards,
    - Nayna

>
>>   		if (delay_msec > TPM2_DURATION_LONG) {
>>   			if (rc == TPM2_RC_RETRY)
>>   				dev_err(&chip->dev, "in retry loop\n");
>> @@ -597,6 +597,7 @@ ssize_t tpm_transmit(struct tpm_chip *chip, struct tpm_space *space,
>>   			break;
>>   		}
>>   		tpm_msleep(delay_msec);
>> +		delay_msec *= 2;
>>   		memcpy(buf, save, save_size);
>>   	}
>>   	return ret;
>> -- 
>> 2.13.6
>>
> /Jarkko
>

  reply	other threads:[~2018-04-06  8:35 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-02 16:20 Nayna Jain
2018-04-05 10:12 ` Jarkko Sakkinen
2018-04-06  8:33   ` Nayna Jain [this message]
2018-04-07 10:36     ` Jarkko Sakkinen
2018-04-09 14:29       ` Mimi Zohar
2018-04-10 12:31         ` Jarkko Sakkinen
2018-04-20  4:48           ` Jarkko Sakkinen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=95af65a1-e618-5cdf-fb81-56434f1aa973@linux.vnet.ibm.com \
    --to=nayna@linux.vnet.ibm.com \
    --cc=jarkko.sakkinen@linux.intel.com \
    --cc=jgunthorpe@obsidianresearch.com \
    --cc=linux-integrity@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-security-module@vger.kernel.org \
    --cc=peterhuewe@gmx.de \
    --cc=tpmdd@selhorst.net \
    --cc=zohar@linux.vnet.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome