[PATCH v3 1/2] tpm: reduce poll sleep time in tpm_transmit()

Nayna Jain nayna at linux.vnet.ibm.com
Mon May 14 10:39:41 UTC 2018



On 05/10/2018 06:11 PM, Nayna Jain wrote:
>
>
> On 05/08/2018 10:04 PM, J Freyensee wrote:
>>
>>>           do {
>>> -            tpm_msleep(TPM_POLL_SLEEP);
>>> +            tpm_msleep(TPM_TIMEOUT_POLL);
>>>
>> I'm just curious why it was decided to still use tpm_msleep() here 
>> instead of usleep_range() which was used in the 2nd patch.
>
> TPM_TIMEOUT_POLL is in msec i.e. 1 msec and usleep_range() is used 
> only when timeout is needed in usecs.

Just to add bit more details:

usleep_range() is used in wait_for_tpm_stat() and get_burstcount() which 
are expected to return quickly. tpm_transmit() is a generic function 
used across all drivers and commands.
Some of the commands (eg. hash, key generation) take longer compared to 
other commands (eg. extend). The sleep time in tpm_transmit is reduced 
but kept in msecs to balance between the smaller and longer commands.

Thanks & Regards,
     - Nayna

>
>>
>> Otherwise,
>>
>> Acked-by: Jay Freyensee <why2jjj.linux at gmail.com>
>
> Thanks !!
>
> Thanks & Regards,
>     - Nayna
>
>

--
To unsubscribe from this list: send the line "unsubscribe linux-security-module" in
the body of a message to majordomo at vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html



More information about the Linux-security-module-archive mailing list