[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210501135727.17747-2-LinoSanfilippo@gmx.de>
Date: Sat, 1 May 2021 15:57:24 +0200
From: Lino Sanfilippo <LinoSanfilippo@....de>
To: peterhuewe@....de, jarkko@...nel.org, jgg@...pe.ca
Cc: stefanb@...ux.vnet.ibm.com, James.Bottomley@...senpartnership.com,
keescook@...omium.org, jsnitsel@...hat.com, ml.linux@...oe.vision,
linux-integrity@...r.kernel.org, linux-kernel@...r.kernel.org,
LinoSanfilippo@....de, Stefan Berger <stefanb@...ux.ibm.com>
Subject: [PATCH v3 1/4] tpm: Use a threaded interrupt handler
The interrupt handler uses tpm_tis_read32() and tpm_tis_write32() to access
the interrupt status register. In case of SPI those accesses are done with
the spi_bus_lock mutex held. This means that the status register cannot
be read or written in interrupt context.
For this reason request a threaded interrupt handler so that the required
accesses can be done in process context.
Reviewed-by: Stefan Berger <stefanb@...ux.ibm.com>
Signed-off-by: Lino Sanfilippo <LinoSanfilippo@....de>
---
drivers/char/tpm/tpm_tis_core.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/char/tpm/tpm_tis_core.c b/drivers/char/tpm/tpm_tis_core.c
index a2e0395cbe61..a12992ae2a3e 100644
--- a/drivers/char/tpm/tpm_tis_core.c
+++ b/drivers/char/tpm/tpm_tis_core.c
@@ -737,8 +737,10 @@ 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) {
+
+ if (devm_request_threaded_irq(chip->dev.parent, irq, NULL,
+ tis_int_handler, IRQF_ONESHOT | flags,
+ dev_name(&chip->dev), chip) != 0) {
dev_info(&chip->dev, "Unable to request irq: %d for probe\n",
irq);
return -1;
--
2.31.1
Powered by blists - more mailing lists