tpm: Provide a generic means to override the chip returned timeouts
authorJason Gunthorpe <jgunthorpe@obsidianresearch.com>
Thu, 22 May 2014 00:26:44 +0000 (18:26 -0600)
committerBen Hutchings <ben@decadent.org.uk>
Sat, 13 Sep 2014 22:41:40 +0000 (23:41 +0100)
commit0f7e814c5af6ce77732ec0ccf3be31ac8aa6b1c4
tree5ae057f6198347f9df7a2b5e546ec1df5faa8353
parent3f3067bb9c7b55bf56b49870ba8d61d88af77c8f
tpm: Provide a generic means to override the chip returned timeouts

commit 8e54caf407b98efa05409e1fee0e5381abd2b088 upstream.

Some Atmel TPMs provide completely wrong timeouts from their
TPM_CAP_PROP_TIS_TIMEOUT query. This patch detects that and returns
new correct values via a DID/VID table in the TIS driver.

Tested on ARM using an AT97SC3204T FW version 37.16

[PHuewe: without this fix these 'broken' Atmel TPMs won't function on
older kernels]
Signed-off-by: "Berg, Christopher" <Christopher.Berg@atmel.com>
Signed-off-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
[bwh: Backported to 3.2:
 - Adjust filename, context
 - s/chip->ops->/chip->vendor./]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
drivers/char/tpm/tpm.c
drivers/char/tpm/tpm.h
drivers/char/tpm/tpm_tis.c