linux/drivers/char
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
..
agp Merge branch 'drm-next' of git://people.freedesktop.org/~airlied/linux 2012-12-17 08:26:17 -08:00
hw_random ARM: arm-soc: multiplatform conversion patches 2012-12-13 10:57:16 -08:00
ipmi Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial 2012-12-13 12:00:02 -08:00
mwave
pcmcia TTY: call tty_port_destroy in the rest of drivers 2012-11-15 17:20:58 -08:00
tpm TPM: Work around buggy TPMs that block during continue self test 2013-02-05 09:38:24 -06:00
xilinx_hwicap char: remove use of __devexit 2012-11-21 12:55:19 -08:00
apm-emulation.c
applicom.c
applicom.h
bfin-otp.c
bsr.c
ds1302.c
ds1620.c ARM: footbridge: nw_gpio_lock is raw_spin_lock 2012-10-07 10:33:12 +02:00
dsp56k.c
dtlk.c
efirtc.c
generic_nvram.c
genrtc.c
hangcheck-timer.c
hpet.c drivers/char: for hpet, add count checking, and ~0UL instead of -1 2012-11-26 16:16:35 -08:00
i8k.c
Kconfig char/misc: remove CONFIG_EXPERIMENTAL dependencies 2012-09-18 16:14:53 +01:00
lp.c
Makefile IPMI: Change link order 2012-10-16 18:07:12 -07:00
mbcs.c char: remove use of __devinitconst 2012-11-21 12:55:19 -08:00
mbcs.h
mem.c /dev/mem: use phys_addr_t for physical addresses 2012-10-24 15:32:50 -07:00
misc.c
mmtimer.c drivers/char/mmtimer.c: Remove useless kfree 2012-09-26 13:20:40 -07:00
msm_smd_pkt.c
mspec.c mm: kill vma flag VM_RESERVED and mm->reserved_vm counter 2012-10-09 16:22:19 +09:00
nsc_gpio.c
nvram.c
nwbutton.c drivers/char: removes unnecessary semicolon 2012-09-26 13:20:39 -07:00
nwbutton.h
nwflash.c Merge branch 'late/fixes' into fixes 2012-10-07 07:22:32 -07:00
pc8736x_gpio.c pc8736x_gpio: use platform_device_unregister in pc8736x_gpio_cleanup() 2012-10-24 15:52:29 -07:00
ppdev.c Merge branch 'master' into for-next 2012-10-28 19:29:19 +01:00
ps3flash.c char: remove use of __devinit 2012-11-21 12:55:19 -08:00
random.c random: prime last_data value per fips requirements 2012-11-08 07:19:18 -05:00
raw.c blockdev: remove bd_block_size_semaphore again 2012-11-29 10:52:19 -08:00
rtc.c drivers/char: removes unnecessary semicolon 2012-09-26 13:20:39 -07:00
scx200_gpio.c
snsc_event.c
snsc.c
snsc.h
sonypi.c char: remove use of __devexit 2012-11-21 12:55:19 -08:00
tb0219.c char: remove use of __devexit 2012-11-21 12:55:19 -08:00
tile-srom.c
tlclk.c drivers/char/tlclk.c: fix error return code 2012-08-16 10:09:15 -07:00
toshiba.c
ttyprintk.c TTY: call tty_port_destroy in the rest of drivers 2012-11-15 17:20:58 -08:00
uv_mmtimer.c
virtio_console.c Some nice cleanups, and even a patch my wife did as a "live" demo for 2012-12-20 08:37:05 -08:00