Skip to content

Commit

Permalink
tpm, tpm_tis: Enable interrupt test
Browse files Browse the repository at this point in the history
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 <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>
  • Loading branch information
Lino Sanfilippo authored and Jarkko Sakkinen committed Apr 24, 2023
1 parent 548eb51 commit e644b2f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions drivers/char/tpm/tpm_tis_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit e644b2f

Please sign in to comment.