linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Lino Sanfilippo <LinoSanfilippo@gmx.de>
To: peterhuewe@gmx.de, jarkko@kernel.org, jgg@ziepe.ca
Cc: stefanb@linux.vnet.ibm.com,
	James.Bottomley@hansenpartnership.com, keescook@chromium.org,
	jsnitsel@redhat.com, ml.linux@elloe.vision,
	linux-integrity@vger.kernel.org, linux-kernel@vger.kernel.org,
	LinoSanfilippo@gmx.de
Subject: [PATCH v3 0/4] Fixes for TPM interrupt handling
Date: Sat,  1 May 2021 15:57:23 +0200	[thread overview]
Message-ID: <20210501135727.17747-1-LinoSanfilippo@gmx.de> (raw)

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 commit 9f67672a817e ("Merge tag 'ext4_for_linus'
of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4") and tested on
on a SLB 9670 which is connected 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 v3:
- fixed compiler error reported by kernel test robot
- rephrased commit message as suggested by Jarko Sakkinen
- added Reviewed-by tag

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(-)


base-commit: 9f67672a817ec046f7554a885f0fe0d60e1bf99f
-- 
2.31.1


             reply	other threads:[~2021-05-01 14:01 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-01 13:57 Lino Sanfilippo [this message]
2021-05-01 13:57 ` [PATCH v3 1/4] tpm: Use a threaded interrupt handler Lino Sanfilippo
2021-05-03 15:14   ` Jarkko Sakkinen
2021-05-04 22:54     ` Lino Sanfilippo
2021-05-06  1:46       ` Jarkko Sakkinen
2021-05-01 13:57 ` [PATCH v3 2/4] tpm: Simplify locality handling Lino Sanfilippo
2021-05-03 15:50   ` Jarkko Sakkinen
2021-05-04 23:15     ` Lino Sanfilippo
2021-05-06  1:47       ` Jarkko Sakkinen
2022-03-24 17:04         ` [PATCH v3 0/4] Fixes for TPM interrupt handling Michael Niewöhner
2022-03-25  2:14           ` Jarkko Sakkinen
2022-03-25 12:32             ` Michael Niewöhner
2022-03-26  3:24               ` Lino Sanfilippo
2022-03-26  8:59                 ` Michael Niewöhner
2022-03-30 15:19                 ` Jarkko Sakkinen
2022-04-20  5:30                 ` Jarkko Sakkinen
2022-04-20  5:32                   ` Jarkko Sakkinen
2022-04-24  2:22                   ` Lino Sanfilippo
2022-04-25 13:57                     ` Jarkko Sakkinen
2022-03-30 15:18               ` Jarkko Sakkinen
2021-05-01 13:57 ` [PATCH v3 3/4] tpm: Fix test for interrupts Lino Sanfilippo
2021-05-03 15:52   ` Jarkko Sakkinen
2021-05-04 23:18     ` Lino Sanfilippo
2021-05-01 13:57 ` [PATCH v3 4/4] tpm: Only enable supported irqs Lino Sanfilippo
2021-05-01 19:09   ` Stefan Berger
2021-05-02  3:15     ` Lino Sanfilippo
2021-05-03 15:52   ` Jarkko Sakkinen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210501135727.17747-1-LinoSanfilippo@gmx.de \
    --to=linosanfilippo@gmx.de \
    --cc=James.Bottomley@hansenpartnership.com \
    --cc=jarkko@kernel.org \
    --cc=jgg@ziepe.ca \
    --cc=jsnitsel@redhat.com \
    --cc=keescook@chromium.org \
    --cc=linux-integrity@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ml.linux@elloe.vision \
    --cc=peterhuewe@gmx.de \
    --cc=stefanb@linux.vnet.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).