linux-integrity.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] tpm_tis_core: Disable broken IRQ handling code
@ 2020-04-09 21:10 Hans de Goede
  2020-04-10 16:38 ` Jason Gunthorpe
  2020-04-10 21:06 ` Jarkko Sakkinen
  0 siblings, 2 replies; 22+ messages in thread
From: Hans de Goede @ 2020-04-09 21:10 UTC (permalink / raw)
  To: Peter Huewe, Jarkko Sakkinen, Jason Gunthorpe, Jerry Snitselaar,
	Stefan Berger
  Cc: Hans de Goede, Arnd Bergmann, Greg Kroah-Hartman, linux-integrity

Since commit dda8b2af395b ("tpm: Revert "tpm_tis_core: Set
TPM_CHIP_FLAG_IRQ before probing for interrupts"") we no longer set
the TPM_CHIP_FLAG_IRQ ever.

So the whole IRQ probing code is not useful, worse we rely on the
IRQ-test path of tpm_tis_send() to call disable_interrupts() if
interrupts do not work, but that path never gets entered because we
never set the TPM_CHIP_FLAG_IRQ.

So the remaining IRQ probe code calls request_irq() and never calls
free_irq() even when the interrupt is not working.

On some systems, e.g. the Lenovo X1 8th gen,  the interrupt we try
to use and never free creates an interrupt storm followed by
an "irq XX: nobody cared" oops.

Since it is non-functional at the moment anyways, lets just completely
disable the IRQ code in tpm_tis_core for now.

Fixes: dda8b2af395b ("tpm: Revert "tpm_tis_core: Set TPM_CHIP_FLAG_IRQ before probing for interrupts"")
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
Note I'm working with Lenovo to try and get to the bottom of this.
---
 drivers/char/tpm/tpm_tis_core.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/drivers/char/tpm/tpm_tis_core.c b/drivers/char/tpm/tpm_tis_core.c
index 27c6ca031e23..647a4a4ccd0c 100644
--- a/drivers/char/tpm/tpm_tis_core.c
+++ b/drivers/char/tpm/tpm_tis_core.c
@@ -697,6 +697,7 @@ static bool tpm_tis_req_canceled(struct tpm_chip *chip, u8 status)
 	}
 }
 
+#if 0 /* See the comment in tpm_tis_core_init */
 static irqreturn_t tis_int_handler(int dummy, void *dev_id)
 {
 	struct tpm_chip *chip = dev_id;
@@ -838,6 +839,7 @@ static void tpm_tis_probe_irq(struct tpm_chip *chip, u32 intmask)
 					     original_int_vec))
 		return;
 }
+#endif
 
 void tpm_tis_remove(struct tpm_chip *chip)
 {
@@ -1048,6 +1050,14 @@ int tpm_tis_core_init(struct device *dev, struct tpm_tis_data *priv, int irq,
 	/* INTERRUPT Setup */
 	init_waitqueue_head(&priv->read_queue);
 	init_waitqueue_head(&priv->int_queue);
+/*
+ * Interrupt support is broken ATM, we never set TPM_CHIP_FLAG_IRQ.
+ * The below code still registers an interrupt handler even though we never
+ * wait for the wait_queues it signals. On some systems the interrupt we try
+ * to use creates an interrupt storm followed by an "irq XX: nobody cared"
+ * oops. So disable this code for now.
+ */
+#if 0
 	if (irq != -1) {
 		/* Before doing irq testing issue a command to the TPM in polling mode
 		 * to make sure it works. May as well use that command to set the
@@ -1069,6 +1079,7 @@ int tpm_tis_core_init(struct device *dev, struct tpm_tis_data *priv, int irq,
 			tpm_tis_probe_irq(chip, intmask);
 		}
 	}
+#endif
 
 	rc = tpm_chip_register(chip);
 	if (rc)
-- 
2.26.0


^ permalink raw reply related	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2020-06-17 22:56 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-09 21:10 [PATCH] tpm_tis_core: Disable broken IRQ handling code Hans de Goede
2020-04-10 16:38 ` Jason Gunthorpe
2020-04-10 21:08   ` Jarkko Sakkinen
2020-04-10 21:12   ` Jarkko Sakkinen
2020-04-14 17:44   ` Jerry Snitselaar
2020-04-15  8:57     ` Jan Lübbe
2020-04-16 17:03     ` Jarkko Sakkinen
2020-04-10 21:06 ` Jarkko Sakkinen
2020-04-10 21:09   ` Jarkko Sakkinen
2020-04-12 14:55     ` Jarkko Sakkinen
2020-05-07 14:02   ` Hans de Goede
2020-05-07 14:02   ` Hans de Goede
2020-05-07 14:17     ` Jerry Snitselaar
2020-05-07 17:38       ` Hans de Goede
2020-05-07 21:51       ` Dan Williams
2020-05-07 23:13         ` Jerry Snitselaar
2020-05-08  7:45         ` Hans de Goede
2020-05-13 21:31         ` Jarkko Sakkinen
2020-06-04  9:17     ` Jerry Snitselaar
2020-06-15 22:06       ` Jarkko Sakkinen
2020-06-16  8:24       ` Hans de Goede
2020-06-17 22:56         ` Jarkko Sakkinen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).