linux-hardened/drivers/char/tpm
Jason Gunthorpe 4643826a3d TPM: Work around buggy TPMs that block during continue self test
We've been testing an alternative TPM for our embedded products and
found random kernel boot failures due to time outs after the continue
self test command.

This was happening randomly, and has been *very* hard to track down, but
it
looks like with this chip there is some kind of race with the
tpm_tis_status()
check of TPM_STS_COMMAND_READY. If things get there 'too fast' then
it sees the chip is ready, or tpm_tis_ready() works. Otherwise it takes
somewhere over 400ms before the chip will return TPM_STS_COMMAND_READY.

Adding some delay after tpm_continue_selftest() makes things reliably
hit the failure path, otherwise it is a crapshot.

The spec says it should be returning TPM_WARN_DOING_SELFTEST, not
holding
off on ready..

Boot log during this event looks like this:

tpm_tis 70030000.tpm_tis: 1.2 TPM (device-id 0x3204, rev-id 64)
tpm_tis 70030000.tpm_tis: Issuing TPM_STARTUP
tpm_tis 70030000.tpm_tis: tpm_transmit: tpm_send: error -62
tpm_tis 70030000.tpm_tis: [Hardware Error]: TPM command timed out during
continue self test
tpm_tis 70030000.tpm_tis: tpm_transmit: tpm_send: error -62
tpm_tis 70030000.tpm_tis: [Hardware Error]: TPM command timed out during
continue self test
tpm_tis 70030000.tpm_tis: tpm_transmit: tpm_send: error -62
tpm_tis 70030000.tpm_tis: [Hardware Error]: TPM command timed out during
continue self test
tpm_tis 70030000.tpm_tis: tpm_transmit: tpm_send: error -62
tpm_tis 70030000.tpm_tis: [Hardware Error]: TPM command timed out during
continue self test

The other TPM vendor we use doesn't show this wonky behaviour:
tpm_tis 70030000.tpm_tis: 1.2 TPM (device-id 0xFE, rev-id 70)

Signed-off-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
Signed-off-by: Kent Yoder <key@linux.vnet.ibm.com>
2013-02-05 09:38:24 -06:00
..
Kconfig TPM: STMicroelectronics ST33 I2C BUILD STUFF 2013-02-05 09:38:23 -06:00
Makefile TPM: STMicroelectronics ST33 I2C BUILD STUFF 2013-02-05 09:38:23 -06:00
tpm.c TPM: Work around buggy TPMs that block during continue self test 2013-02-05 09:38:24 -06:00
tpm.h tpm: rename vendor data to priv and provide an accessor 2013-02-05 09:38:23 -06:00
tpm_acpi.c TPM: Switch to __packed instead of __attribute__((packed)) 2013-02-05 09:38:22 -06:00
tpm_atmel.c tpm_atmel: Use struct dev_pm_ops for power management 2012-07-10 21:37:02 +02:00
tpm_atmel.h tpmdd maintainers 2007-08-22 19:52:44 -07:00
tpm_eventlog.c tpm: modularize event log collection 2012-08-22 11:11:25 -05:00
tpm_eventlog.h drivers/char/tpm: Add securityfs support for event log 2012-08-22 16:22:47 -05:00
tpm_i2c_infineon.c Char/Misc driver merge for 3.8-rc1 2012-12-11 13:56:38 -08:00
tpm_i2c_stm_st33.c tpm_i2c_stm_st33: fix oops when i2c client is unavailable 2013-02-05 09:38:24 -06:00
tpm_i2c_stm_st33.h tpm_i2c_stm_st33: fix oops when i2c client is unavailable 2013-02-05 09:38:24 -06:00
tpm_ibmvtpm.c tpm: rename vendor data to priv and provide an accessor 2013-02-05 09:38:23 -06:00
tpm_ibmvtpm.h drivers/char/tpm: remove tasklet and cleanup 2012-11-01 15:23:14 -05:00
tpm_infineon.c Char/Misc driver merge for 3.8-rc1 2012-12-11 13:56:38 -08:00
tpm_nsc.c tpm_nsc: Use struct dev_pm_ops for power management 2012-07-10 21:37:18 +02:00
tpm_of.c drivers/char/tpm: Add securityfs support for event log 2012-08-22 16:22:47 -05:00
tpm_ppi.c driver/char/tpm: fix regression causesd by ppi 2012-10-10 09:50:56 -05:00
tpm_tis.c char/tpm: Use true and false for bools 2013-02-05 09:38:22 -06:00