TPM: Wait for TPM_ACCESS tpmRegValidSts to go high at startup
authorJason Gunthorpe <jgunthorpe@obsidianresearch.com>
Thu, 6 Dec 2012 22:44:54 +0000 (15:44 -0700)
committerKent Yoder <key@linux.vnet.ibm.com>
Tue, 5 Feb 2013 15:38:25 +0000 (09:38 -0600)
commit7240b98320a28f1d41b9361dc1cc8244dfda0272
treecbe8d1548d15e66775b8f8f74cc734aa4e64b37e
parent78f09cc248731716633c0ef219613e762a9c4f2e
TPM: Wait for TPM_ACCESS tpmRegValidSts to go high at startup

The TIS specification (pg 47) says the valid bit must be set, but
the TPM will not set it until it has completed its internal startup.

The driver checks that the valid bit is set during request_locality,
but it issues a TPM_ACCESS_REQUEST_USE without validating the
valid bit is set.

Some TPMs will ignore the TPM_ACCESS_REQUEST_USE, until valid is
set which causes the request_locality to timeout, which breaks the
driver attach.

Wait one timeout unit for valid to assert. If valid does not assert
then assume -ENODEV.

Seen on embedded with a:
1.2 TPM (device-id 0x3204, rev-id 64)

Signed-off-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
Signed-off-by: Kent Yoder <key@linux.vnet.ibm.com>
drivers/char/tpm/tpm_tis.c