]> git.ipfire.org Git - thirdparty/linux.git/commit
tpm, tpm_tis: Workaround failed command reception on Infineon devices
authorJonathan McDowell <noodles@meta.com>
Wed, 12 Mar 2025 05:26:18 +0000 (07:26 +0200)
committerJarkko Sakkinen <jarkko@kernel.org>
Thu, 27 Mar 2025 13:34:05 +0000 (15:34 +0200)
commitde9e33df7762abbfc2a1568291f2c3a3154c6a9d
treef0f47e338414b040486b42dbf8357f122f628b91
parent7146dffa875cd00e7a7f918e1fce79c7593ac1fa
tpm, tpm_tis: Workaround failed command reception on Infineon devices

Some Infineon devices have a issue where the status register will get
stuck with a quick REQUEST_USE / COMMAND_READY sequence. This is not
simply a matter of requiring a longer timeout; the work around is to
retry the command submission. Add appropriate logic to do this in the
send path.

This is fixed in later firmware revisions, but those are not always
available, and cannot generally be easily updated from outside a
firmware environment.

Testing has been performed with a simple repeated loop of doing a
TPM2_CC_GET_CAPABILITY for TPM_CAP_PROP_MANUFACTURER using the Go code
at:

  https://the.earth.li/~noodles/tpm-stuff/timeout-reproducer-simple.go

It can take several hours to reproduce, and several million operations.

Signed-off-by: Jonathan McDowell <noodles@meta.com>
Reviewed-by: Jarkko Sakkinen <jarkko@kernel.org>
Signed-off-by: Jarkko Sakkinen <jarkko@kernel.org>
drivers/char/tpm/tpm_tis_core.c
drivers/char/tpm/tpm_tis_core.h
include/linux/tpm.h