[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20191112202725.3009814-1-stefanb@linux.vnet.ibm.com>
Date: Tue, 12 Nov 2019 15:27:25 -0500
From: Stefan Berger <stefanb@...ux.vnet.ibm.com>
To: linux-integrity@...r.kernel.org, jsnitsel@...hat.com,
jarkko.sakkinen@...ux.intel.com
Cc: linux-kernel@...r.kernel.org,
linux-security-module@...r.kernel.org,
Stefan Berger <stefanb@...ux.ibm.com>
Subject: [PATCH] tpm_tis: Move setting of TPM_CHIP_FLAG_IRQ into tpm_tis_probe_irq_single
From: Stefan Berger <stefanb@...ux.ibm.com>
Move the setting of the TPM_CHIP_FLAG_IRQ for irq probing into
tpm_tis_probe_irq_single before calling tpm_tis_gen_interrupt.
This move handles error conditions better that may arise if anything
before fails in tpm_tis_probe_irq_single.
Signed-off-by: Stefan Berger <stefanb@...ux.ibm.com>
Suggested-by: Jerry Snitselaar <jsnitsel@...hat.com>
---
drivers/char/tpm/tpm_tis_core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/char/tpm/tpm_tis_core.c b/drivers/char/tpm/tpm_tis_core.c
index 8af2cee1a762..6b6605890c7d 100644
--- a/drivers/char/tpm/tpm_tis_core.c
+++ b/drivers/char/tpm/tpm_tis_core.c
@@ -790,6 +790,7 @@ static int tpm_tis_probe_irq_single(struct tpm_chip *chip, u32 intmask,
return rc;
priv->irq_tested = false;
+ chip->flags |= TPM_CHIP_FLAG_IRQ;
/* Generate an interrupt by having the core call through to
* tpm_tis_send
@@ -1060,7 +1061,6 @@ int tpm_tis_core_init(struct device *dev, struct tpm_tis_data *priv, int irq,
}
tpm_chip_start(chip);
- chip->flags |= TPM_CHIP_FLAG_IRQ;
if (irq) {
tpm_tis_probe_irq_single(chip, intmask, IRQF_SHARED,
irq);
--
2.14.5
Powered by blists - more mailing lists