linux-integrity.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/4] Fixes for TPM interrupt handling
@ 2021-04-25 23:47 Lino Sanfilippo
  2021-04-25 23:47 ` [PATCH v2 1/4] tpm: Use a threaded interrupt handler Lino Sanfilippo
                   ` (3 more replies)
  0 siblings, 4 replies; 17+ messages in thread
From: Lino Sanfilippo @ 2021-04-25 23:47 UTC (permalink / raw)
  To: peterhuewe, jarkko, jgg
  Cc: stefanb, James.Bottomley, keescook, jsnitsel, ml.linux,
	linux-integrity, linux-kernel, LinoSanfilippo

This series enables interrupts for TPM. For this some obstacles had to be
removed first, like the interrupt handler running in interrupt context and
thus not allowing to access registers over SPI. Also the locality handling
has been simplified to make a complicated synchronization between threads
and irq handler unnecessary. As a side effect of this simplification a bug
is fixed in which a TMP command is issued without a claimed locality in
case of TPM 2.
Another fix concerns the interrupt test which currently is broken.
Finally the results of the capability query at startup is used to only set
the interrupts which are actually supported by the hardware.

These patches are based on Linux mainline V5.12 and tested on a SLB 9670
which uses TPM 2 via SPI.

Of course any further testing is highly appreciated.

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 bug
in case of TMP 2.

PATCH 3: Fix and simplify the test for interrupts.

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

Changes in v2:
- rebase against 5.12
- free irq on error path

Lino Sanfilippo (4):
  tpm: Use a threaded interrupt handler
  tpm: Simplify locality handling
  tpm: Fix test for interrupts
  tpm: Only enable supported irqs

 drivers/char/tpm/tpm-chip.c     |  40 ----------
 drivers/char/tpm/tpm_tis_core.c | 170 +++++++++++++++++-----------------------
 drivers/char/tpm/tpm_tis_core.h |   2 +-
 include/linux/tpm.h             |   5 +-
 4 files changed, 72 insertions(+), 145 deletions(-)

-- 
2.7.4


^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2021-05-01  9:01 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-25 23:47 [PATCH v2 0/4] Fixes for TPM interrupt handling Lino Sanfilippo
2021-04-25 23:47 ` [PATCH v2 1/4] tpm: Use a threaded interrupt handler Lino Sanfilippo
2021-04-26 14:37   ` Stefan Berger
2021-04-27 23:53   ` Jarkko Sakkinen
2021-04-28 22:37     ` Lino Sanfilippo
2021-04-29  6:58       ` Jarkko Sakkinen
2021-05-01  9:01         ` Lino Sanfilippo
2021-04-25 23:47 ` [PATCH v2 2/4] tpm: Simplify locality handling Lino Sanfilippo
2021-04-27 23:49   ` Jarkko Sakkinen
2021-04-28  7:13     ` Peter.Huewe
2021-04-28 22:44     ` Lino Sanfilippo
2021-04-25 23:47 ` [PATCH v2 3/4] tpm: Fix test for interrupts Lino Sanfilippo
2021-04-26 14:49   ` Stefan Berger
2021-04-28 22:13     ` Lino Sanfilippo
2021-04-25 23:47 ` [PATCH v2 4/4] tpm: Only enable supported irqs Lino Sanfilippo
2021-04-26  5:08   ` kernel test robot
2021-04-26 14:23   ` Stefan Berger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).