Re: TPM selftest failure in 4.15

Jason Gunthorpe
2018-02-01T17:41:00Z

On Thu, Feb 01, 2018 at 03:24:08PM +0000, James Bottomley wrote:

> OK, I investigated but now my TPM has returned to normal (as in it
> passes the selftest immediately). There's clearly something that makes
> it return TPM_RC_TESTING to every self test probe for seconds at a
> time, but I don't know what it is. Sending a different command seems
> to cause the problem to clear (Managed to reproduce once with the patch
> to verify), so this is my proposed fix. It's clearly nonsensical to
> detach the driver because the self test still returns TPM_RC_TESTING,
> so convert that return to a TPM_RC_SUCCESS on timeout. It prints a
> warning message so we'll see it in the logs if it causes problems.
> Given that this seems to be some type of internal TPM issue, I don't
> believe changing the timings would work.

But if a selftest returns TPM2_RC_TESTING I would expect the next
command to also fail with a testing in progress code? At least by the
spec..

The point of invoking selftest is to get to a state where future TPM
commands will succeed, so returning immediately on RC_TESTING seems
wrong?

Jason