[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Yr4yh4u+wSWU1ux5@kernel.org>
Date: Fri, 1 Jul 2022 02:32:23 +0300
From: Jarkko Sakkinen <jarkko@...nel.org>
To: Lino Sanfilippo <LinoSanfilippo@....de>
Cc: peterhuewe@....de, jgg@...pe.ca, stefanb@...ux.vnet.ibm.com,
linux@...ewoehner.de, linux-integrity@...r.kernel.org,
linux-kernel@...r.kernel.org, l.sanfilippo@...bus.com,
lukas@...ner.de, p.rosenberger@...bus.com
Subject: Re: [PATCH v7 08/10] tpm, tpm_tis: Request threaded interrupt handler
On Thu, Jun 30, 2022 at 01:26:51AM +0200, Lino Sanfilippo wrote:
> From: Lino Sanfilippo <l.sanfilippo@...bus.com>
>
> 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@...bus.com>
> Tested-by: Michael Niew??hner <linux@...ewoehner.de>
> ---
> drivers/char/tpm/tpm_tis_core.c | 7 +++++--
> 1 file changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/char/tpm/tpm_tis_core.c b/drivers/char/tpm/tpm_tis_core.c
> index e50a2c78de9f..83b31c25e55c 100644
> --- a/drivers/char/tpm/tpm_tis_core.c
> +++ b/drivers/char/tpm/tpm_tis_core.c
> @@ -802,8 +802,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;
> --
> 2.25.1
>
Reviewed-by: Jarkko Sakkinen <jarkko@...nel.org>
BR, Jarkko
Powered by blists - more mailing lists