]> git.ipfire.org Git - thirdparty/kernel/stable.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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 20 Apr 2025 08:15:27 +0000 (10:15 +0200)
commit01c2ed3f7dcef2f6e1c55da902f07310203ef790
treebacf46e4a1e2b987fade9717206147a815b72b28
parenta4e3c80cecbe724176811475cfb3ec654c24c5a0
tpm, tpm_tis: Workaround failed command reception on Infineon devices

[ Upstream commit de9e33df7762abbfc2a1568291f2c3a3154c6a9d ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/char/tpm/tpm_tis_core.c
drivers/char/tpm/tpm_tis_core.h
include/linux/tpm.h