diff mbox series

[v4,3/6] tpm, tpm_tis: enable irq test

Message ID 20220509080559.4381-4-LinoSanfilippo@gmx.de (mailing list archive)
State New, archived
Headers show
Series TPM irq fixes | expand

Commit Message

Lino Sanfilippo May 9, 2022, 8:05 a.m. UTC
From: Lino Sanfilippo <l.sanfilippo@kunbus.com>

The test for working irqs which is done in tpm_tis_send() is only executed
if both priv->irq_tested is false and TPM_CHIP_FLAG_IRQ is set in
chip->flags.

While the first condition is initially met, the TPM_CHIP_FLAG_IRQ flag is
never set, which prevents the irq test from being ever executed. Fix this
by setting TPM_CHIP_FLAG_IRQ just before the test is made.

Signed-off-by: Lino Sanfilippo <l.sanfilippo@kunbus.com>
---
 drivers/char/tpm/tpm_tis_core.c | 1 +
 1 file changed, 1 insertion(+)
diff mbox series

Patch

diff --git a/drivers/char/tpm/tpm_tis_core.c b/drivers/char/tpm/tpm_tis_core.c
index 46f504fb5084..4f3b82c3f205 100644
--- a/drivers/char/tpm/tpm_tis_core.c
+++ b/drivers/char/tpm/tpm_tis_core.c
@@ -781,6 +781,7 @@  static int tpm_tis_probe_irq_single(struct tpm_chip *chip, u32 intmask,
 		return rc;
 
 	priv->irq_tested = false;
+	chip->flags |= TPM_CHIP_FLAG_IRQ;
 
 	/* Generate an interrupt by having the core call through to
 	 * tpm_tis_send