mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-06 02:50:49 +09:00
tpm, tpm_tis: Disable interrupts if tpm_tis_probe_irq() failed
[ Upstream commit6d789ad726] Both functions tpm_tis_probe_irq_single() and tpm_tis_probe_irq() may setup the interrupts and then return with an error. This case is indicated by a missing TPM_CHIP_FLAG_IRQ flag in chip->flags. Currently the interrupt setup is only undone if tpm_tis_probe_irq_single() fails. Undo the setup also if tpm_tis_probe_irq() fails. 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> Stable-dep-of:955df4f877("tpm, tpm_tis: Claim locality when interrupts are reenabled on resume") Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
cbb1dd2705
commit
35ca7f6252
@@ -1069,21 +1069,21 @@ int tpm_tis_core_init(struct device *dev, struct tpm_tis_data *priv, int irq,
|
|||||||
goto out_err;
|
goto out_err;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (irq) {
|
if (irq)
|
||||||
tpm_tis_probe_irq_single(chip, intmask, IRQF_SHARED,
|
tpm_tis_probe_irq_single(chip, intmask, IRQF_SHARED,
|
||||||
irq);
|
irq);
|
||||||
if (!(chip->flags & TPM_CHIP_FLAG_IRQ)) {
|
else
|
||||||
dev_err(&chip->dev, FW_BUG
|
tpm_tis_probe_irq(chip, intmask);
|
||||||
|
|
||||||
|
if (!(chip->flags & TPM_CHIP_FLAG_IRQ)) {
|
||||||
|
dev_err(&chip->dev, FW_BUG
|
||||||
"TPM interrupt not working, polling instead\n");
|
"TPM interrupt not working, polling instead\n");
|
||||||
|
|
||||||
rc = request_locality(chip, 0);
|
rc = request_locality(chip, 0);
|
||||||
if (rc < 0)
|
if (rc < 0)
|
||||||
goto out_err;
|
goto out_err;
|
||||||
disable_interrupts(chip);
|
disable_interrupts(chip);
|
||||||
release_locality(chip, 0);
|
release_locality(chip, 0);
|
||||||
}
|
|
||||||
} else {
|
|
||||||
tpm_tis_probe_irq(chip, intmask);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user