aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char
diff options
context:
space:
mode:
authorMartin Wilck <Martin.Wilck@ts.fujitsu.com>2015-11-09 09:38:50 -0500
committerJarkko Sakkinen <jarkko.sakkinen@linux.intel.com>2015-11-09 10:52:54 -0500
commit14b5c1c9159bf6f109b667d31da82859d8c8cdcd (patch)
treea87c5b9fefeeee58a28777dff292eab58210f827 /drivers/char
parent2aef9da60bfdeb68dbcd4f114c098cbaa841b4ee (diff)
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: Martin Wilck <Martin.Wilck@ts.fujitsu.com> Acked-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com> Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com> Acked-by: Peter Huewe <PeterHuewe@gmx.de>
Diffstat (limited to 'drivers/char')
-rw-r--r--drivers/char/tpm/tpm_tis.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/char/tpm/tpm_tis.c b/drivers/char/tpm/tpm_tis.c
index 19f9c7dc7bc0..65f7eecc45b0 100644
--- a/drivers/char/tpm/tpm_tis.c
+++ b/drivers/char/tpm/tpm_tis.c
@@ -645,6 +645,7 @@ static int tpm_tis_init(struct device *dev, struct tpm_info *tpm_info,
645{ 645{
646 u32 vendor, intfcaps, intmask; 646 u32 vendor, intfcaps, intmask;
647 int rc, i, irq_s, irq_e, probe; 647 int rc, i, irq_s, irq_e, probe;
648 int irq_r = -1;
648 struct tpm_chip *chip; 649 struct tpm_chip *chip;
649 struct priv_data *priv; 650 struct priv_data *priv;
650 651
@@ -751,6 +752,7 @@ static int tpm_tis_init(struct device *dev, struct tpm_info *tpm_info,
751 irq_s = 752 irq_s =
752 ioread8(chip->vendor.iobase + 753 ioread8(chip->vendor.iobase +
753 TPM_INT_VECTOR(chip->vendor.locality)); 754 TPM_INT_VECTOR(chip->vendor.locality));
755 irq_r = irq_s;
754 if (irq_s) { 756 if (irq_s) {
755 irq_e = irq_s; 757 irq_e = irq_s;
756 } else { 758 } else {
@@ -833,7 +835,9 @@ static int tpm_tis_init(struct device *dev, struct tpm_info *tpm_info,
833 chip->vendor.iobase + 835 chip->vendor.iobase +
834 TPM_INT_ENABLE(chip->vendor.locality)); 836 TPM_INT_ENABLE(chip->vendor.locality));
835 } 837 }
836 } 838 } else if (irq_r != -1)
839 iowrite8(irq_r, chip->vendor.iobase +
840 TPM_INT_VECTOR(chip->vendor.locality));
837 841
838 if (chip->flags & TPM_CHIP_FLAG_TPM2) { 842 if (chip->flags & TPM_CHIP_FLAG_TPM2) {
839 chip->vendor.timeout_a = msecs_to_jiffies(TPM2_TIMEOUT_A); 843 chip->vendor.timeout_a = msecs_to_jiffies(TPM2_TIMEOUT_A);