#1 tpm timeouts and durations fix

open
nobody
None
5
2008-02-26
2008-02-26
Marcin Obara
No

patch to fix bug:
[ 1902441 ] timeouts too long

According to TCG TPM Specification Version 1.2 Revision 103
timeouts and durations are returned in microseconds (10 ^ -6 s)

mainP2Structrev103.pdf,
page 166 :
"
TPM_CAP_PROP_TIS_TIMEOUT
An 4 element array of UINT32 values each denoting the timeout value in
microseconds for the
following in the order:
TIMEOUT_A, TIMEOUT_B, TIMEOUT_C, TIMEOUT_D
[...]
"

page 167 :
"
TPM_CAP_PROP_DURATION
An 4 element array of UINT32 values each denoting the duration value
in microseconds [...]
"

tpm.c code converts above timeouts to jiffies using msecs_to_jiffies(),
but input value for msesc_to_jiffies() have to be defined in
miliseconds (10 ^ -3 s).
In result - timeouts are 1000 times longer!
To convert microseconds to jiffies - usecs_to_jiffies() should be used.

Discussion