Skip to content

Commit b160c94

Browse files
author
Jarkko Sakkinen
committed
tpm/tpm_tis: Free IRQ if probing fails
Call disable_interrupts() if we have to revert to polling in order not to unnecessarily reserve the IRQ for the life-cycle of the driver. Cc: [email protected] # 4.5.x Reported-by: Hans de Goede <[email protected]> Fixes: e3837e7 ("tpm_tis: Refactor the interrupt setup") Signed-off-by: Jarkko Sakkinen <[email protected]>
1 parent 29cb797 commit b160c94

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

drivers/char/tpm/tpm_tis_core.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -433,6 +433,9 @@ static void disable_interrupts(struct tpm_chip *chip)
433433
u32 intmask;
434434
int rc;
435435

436+
if (priv->irq == 0)
437+
return;
438+
436439
rc = tpm_tis_read32(priv, TPM_INT_ENABLE(priv->locality), &intmask);
437440
if (rc < 0)
438441
intmask = 0;
@@ -1062,9 +1065,12 @@ int tpm_tis_core_init(struct device *dev, struct tpm_tis_data *priv, int irq,
10621065
if (irq) {
10631066
tpm_tis_probe_irq_single(chip, intmask, IRQF_SHARED,
10641067
irq);
1065-
if (!(chip->flags & TPM_CHIP_FLAG_IRQ))
1068+
if (!(chip->flags & TPM_CHIP_FLAG_IRQ)) {
10661069
dev_err(&chip->dev, FW_BUG
10671070
"TPM interrupt not working, polling instead\n");
1071+
1072+
disable_interrupts(chip);
1073+
}
10681074
} else {
10691075
tpm_tis_probe_irq(chip, intmask);
10701076
}

0 commit comments

Comments
 (0)