]> Git Repo - linux.git/commitdiff
tpm, tpm_tis: Enable interrupt test
authorLino Sanfilippo <[email protected]>
Thu, 24 Nov 2022 13:55:38 +0000 (14:55 +0100)
committerJarkko Sakkinen <[email protected]>
Mon, 24 Apr 2023 13:15:53 +0000 (16:15 +0300)
The test for interrupts in tpm_tis_send() is skipped if the flag
TPM_CHIP_FLAG_IRQ is not set. Since the current code never sets the flag
initially the test is never executed.

Fix this by setting the flag in tpm_tis_gen_interrupt() right after
interrupts have been enabled and before the test is executed.

Signed-off-by: Lino Sanfilippo <[email protected]>
Tested-by: Michael Niewöhner <[email protected]>
Tested-by: Jarkko Sakkinen <[email protected]>
Reviewed-by: Jarkko Sakkinen <[email protected]>
Signed-off-by: Jarkko Sakkinen <[email protected]>
drivers/char/tpm/tpm_tis_core.c

index 5b01a3df65a61fac12531bf2565ddff34a40a182..c2421162cf345794b81288bba2b91217666b4dd1 100644 (file)
@@ -793,10 +793,15 @@ static void tpm_tis_gen_interrupt(struct tpm_chip *chip)
        cap_t cap;
        int ret;
 
+       chip->flags |= TPM_CHIP_FLAG_IRQ;
+
        if (chip->flags & TPM_CHIP_FLAG_TPM2)
                ret = tpm2_get_tpm_pt(chip, 0x100, &cap2, desc);
        else
                ret = tpm1_getcap(chip, TPM_CAP_PROP_TIS_TIMEOUT, &cap, desc, 0);
+
+       if (ret)
+               chip->flags &= ~TPM_CHIP_FLAG_IRQ;
 }
 
 /* Register the IRQ and issue a command that will cause an interrupt. If an
This page took 0.050834 seconds and 4 git commands to generate.