On Tue, Mar 01, 2011 at 06:14:25PM -0300, Rajiv Andrade wrote:The bug was that when running the kernel with IMA, at boot time, it issues 3 TPM commands IIRC, given the 2 min timeout,I was referring to the first, 9b29050f, and the commitc4ff4b82 reverted by Ted fixes a bug for other users.What's the bug that other users suffer by having a longer timeout? It
means that if things fails it takes longer for them to get an error
message in the case of something that's going to fail anyway, right?
Somehow that seems less serious than the TPM simply completely failing
to function caused by too-short timeouts. (My situation). So sorry
if I'm feeling selfish, but a longer timeout before returning failure
seems less important than my not being able to access the TPM at all.
So, the results of my experiments. First of all, trying to merge inThanks, it is. HZ isn't enough time for this TPM/setup to have short timeout commands to succeed, including
your for_james branch doesn't help at all. I used the tip of Linus's
tree as of this morning (commit 3e1f2356ce2) and then merged in your
for-james tree (commit b83452256e). No go. I tried setting the
interrupts parameter to both 0 and 1, and either way, things still
didn't work.
OK, next, I tried Linus's idea, which was to put a WARN macro here in
tpm_calc_ordinal_duration:
if (duration_idx != TPM_UNDEFINED) {
duration = chip->vendor.duration[duration_idx];
/* if duration is 0, it's because chip->vendor.duration wasn't \
*/
/* filled yet, so we set the lowest timeout just to give enough\
*/
/* time for tpm_get_timeouts() to succeed */
NEW ----> WARN(duration<=0,
"no duration for ordinal %x (diration_idx %d)",
ordinal, duration_idx);
return (duration<= 0 ? HZ : duration);
} else
return 2 * 60 * HZ;
}
That resulted in the following data (see attached), which you will
hopefully find useful.