CHROMIUM: tpm: reconcile mainline changes with resume strategy
Our local changes were no longer compatible with the mainline changes
to tpm_continue_selftest. This introduces the helper function
tpm_continue_selftest_nocheck, which avoids recursion in transmit_cmd.
A large comment also attempts to explain more clearly what is going
on.
The new mainline function tpm_do_selftest hides differences between
TPMs by calling tpm_continue_selftest, then checking if the self test
has completed or not. (TPM_ContinueSelfTest unfortunately allows
both behaviors.) This probably works fine, but it would add hundreds
of milliseconds to our resume path.
This fix is necessary because our version of tpm_continue_selftest
was not returning an error code, but the length of the response packet,
which was interpreted as a weird error code.
To test, I ran "powerd_suspend; tpmc getvf", looked at the log, and
noted that waiting for the self test to complete would have cost us
over 300ms.
BUG=chromium-os:31065
TEST=manual test
Change-Id: Iff09a9759c31ea93cd58c7ba32114b04e67e2359
Signed-off-by: Luigi Semenzato <semenzato@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/23299
Reviewed-by: Grant Grundler <grundler@chromium.org>