[PATCH 0/4] Fixes for TPM interrupt handling

From: Lino Sanfilippo
Date: Sun Feb 21 2021 - 19:59:06 EST


This series fixes issues around the TPM driver interrupt handling. These
issues prevent TPM chips like the SLB 9670 to work over SPI.

PATCH 1: The SPI implementation of the functions to read/write to/from
registers uses mutexes and thus require a sleepable context. For this
reason request a threaded interrupt handler.

PATCH 2: Simplify locality handling by taking the driver locality (0) at
driver startup and releasing it at driver shutdown. This also fixes a
warning at driver startup that is caused by a register access without prior
locality request.

PATCH 3: Fix and simplify the test for working interrupts.

PATCH 4: Only set the interrupts which are reported as being available.

With these patches applied the SLB 9670 works as expected: interrupts are
detected and the transmit/receive operations are controlled by interrupt
handling.

The patches are based on Linux mainline V5.11


Lino Sanfilippo (4):
tpm: Use a threaded interrupt handler
tpm: get locality before writing to TPM chip
tpm: Fix test for interrupts
tpm: Only enable supported irqs

drivers/char/tpm/tpm-chip.c | 10 ----
drivers/char/tpm/tpm_tis_core.c | 127 +++++++++++++++++++---------------------
drivers/char/tpm/tpm_tis_core.h | 2 +-
include/linux/tpm.h | 2 +-
4 files changed, 62 insertions(+), 79 deletions(-)

--
2.7.4