tpm, tpm_tis: Only handle supported interrupts
authorLino Sanfilippo <l.sanfilippo@kunbus.com>
Thu, 24 Nov 2022 13:55:30 +0000 (14:55 +0100)
committerJarkko Sakkinen <jarkko@kernel.org>
Mon, 24 Apr 2023 13:15:53 +0000 (16:15 +0300)
commite87fcf0dc2b47fac5b4824f00f74dfbcd4acd363
tree6a2889a065f1123fbd78c38a07d5bcb321c0b7c2
parent15d7aa4e46eba87242a320f39773aa16faddadee
tpm, tpm_tis: Only handle supported interrupts

According to the TPM Interface Specification (TIS) support for "stsValid"
and "commandReady" interrupts is only optional.
This has to be taken into account when handling the interrupts in functions
like wait_for_tpm_stat(). To determine the supported interrupts use the
capability query.

Also adjust wait_for_tpm_stat() to only wait for interrupt reported status
changes. After that process all the remaining status changes by polling
the status register.

Signed-off-by: Lino Sanfilippo <l.sanfilippo@kunbus.com>
Tested-by: Michael Niewöhner <linux@mniewoehner.de>
Tested-by: Jarkko Sakkinen <jarkko@kernel.org>
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