summaryrefslogtreecommitdiff
path: root/drivers/char
diff options
context:
space:
mode:
authorLino Sanfilippo <l.sanfilippo@kunbus.com>2022-11-24 14:55:34 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-06-09 10:34:28 +0200
commit3264d875f58a03aa60ddf7df6f05423db735480d (patch)
tree76c5f74a391af90c1f19ae80ed9fdb51f3184994 /drivers/char
parent77ee4f8c02b803b77cc7cf19c7000d7e7de4e849 (diff)
downloadlinux-3264d875f58a03aa60ddf7df6f05423db735480d.tar.gz
linux-3264d875f58a03aa60ddf7df6f05423db735480d.tar.bz2
linux-3264d875f58a03aa60ddf7df6f05423db735480d.zip
tpm, tpm_tis: Request threaded interrupt handler
commit 0c7e66e5fd69bf21034c9a9b081d7de7c3eb2cea upstream. The TIS interrupt handler at least has to read and write the interrupt status register. In case of SPI both operations result in a call to tpm_tis_spi_transfer() which uses the bus_lock_mutex of the spi device and thus must only be called from a sleepable context. To ensure this request a threaded interrupt handler. 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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/char')
-rw-r--r--drivers/char/tpm/tpm_tis_core.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/char/tpm/tpm_tis_core.c b/drivers/char/tpm/tpm_tis_core.c
index f02b583005a5..e05d2b227de3 100644
--- a/drivers/char/tpm/tpm_tis_core.c
+++ b/drivers/char/tpm/tpm_tis_core.c
@@ -805,8 +805,11 @@ static int tpm_tis_probe_irq_single(struct tpm_chip *chip, u32 intmask,
int rc;
u32 int_status;
- if (devm_request_irq(chip->dev.parent, irq, tis_int_handler, flags,
- dev_name(&chip->dev), chip) != 0) {
+
+ rc = devm_request_threaded_irq(chip->dev.parent, irq, NULL,
+ tis_int_handler, IRQF_ONESHOT | flags,
+ dev_name(&chip->dev), chip);
+ if (rc) {
dev_info(&chip->dev, "Unable to request irq: %d for probe\n",
irq);
return -1;