Commit 14b5c1c9 authored by Martin Wilck's avatar Martin Wilck Committed by Jarkko Sakkinen

tpm_tis: restore IRQ vector in IO memory after failed probing

If the probing finishes without success, it will leave the value 15 in
the TPM_IRQ_VECTOR register. If the driver is unloaded and reloaded, it
will "think" that the hardware had been programmed with IRQ 15, and will
not probe again.

This patch restores the original value in the IO memory if no IRQ is
probed.
Signed-off-by: default avatarMartin Wilck <Martin.Wilck@ts.fujitsu.com>
Acked-by: default avatarJarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Signed-off-by: default avatarJarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Acked-by: default avatarPeter Huewe <PeterHuewe@gmx.de>
parent 2aef9da6
...@@ -645,6 +645,7 @@ static int tpm_tis_init(struct device *dev, struct tpm_info *tpm_info, ...@@ -645,6 +645,7 @@ static int tpm_tis_init(struct device *dev, struct tpm_info *tpm_info,
{ {
u32 vendor, intfcaps, intmask; u32 vendor, intfcaps, intmask;
int rc, i, irq_s, irq_e, probe; int rc, i, irq_s, irq_e, probe;
int irq_r = -1;
struct tpm_chip *chip; struct tpm_chip *chip;
struct priv_data *priv; struct priv_data *priv;
...@@ -751,6 +752,7 @@ static int tpm_tis_init(struct device *dev, struct tpm_info *tpm_info, ...@@ -751,6 +752,7 @@ static int tpm_tis_init(struct device *dev, struct tpm_info *tpm_info,
irq_s = irq_s =
ioread8(chip->vendor.iobase + ioread8(chip->vendor.iobase +
TPM_INT_VECTOR(chip->vendor.locality)); TPM_INT_VECTOR(chip->vendor.locality));
irq_r = irq_s;
if (irq_s) { if (irq_s) {
irq_e = irq_s; irq_e = irq_s;
} else { } else {
...@@ -833,7 +835,9 @@ static int tpm_tis_init(struct device *dev, struct tpm_info *tpm_info, ...@@ -833,7 +835,9 @@ static int tpm_tis_init(struct device *dev, struct tpm_info *tpm_info,
chip->vendor.iobase + chip->vendor.iobase +
TPM_INT_ENABLE(chip->vendor.locality)); TPM_INT_ENABLE(chip->vendor.locality));
} }
} } else if (irq_r != -1)
iowrite8(irq_r, chip->vendor.iobase +
TPM_INT_VECTOR(chip->vendor.locality));
if (chip->flags & TPM_CHIP_FLAG_TPM2) { if (chip->flags & TPM_CHIP_FLAG_TPM2) {
chip->vendor.timeout_a = msecs_to_jiffies(TPM2_TIMEOUT_A); chip->vendor.timeout_a = msecs_to_jiffies(TPM2_TIMEOUT_A);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment