linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] tpm_tis: reserve chip for duration of tpm_tis_core_init
@ 2019-12-11 23:17 Jerry Snitselaar
  2019-12-11 23:26 ` Jerry Snitselaar
                   ` (2 more replies)
  0 siblings, 3 replies; 26+ messages in thread
From: Jerry Snitselaar @ 2019-12-11 23:17 UTC (permalink / raw)
  To: linux-kernel
  Cc: Christian Bundy, Dan Williams, Peter Huewe, Jarkko Sakkinen,
	Jason Gunthorpe, Stefan Berger, stable, linux-intergrity

Instead of repeatedly calling tpm_chip_start/tpm_chip_stop when
issuing commands to the tpm during initialization, just reserve the
chip after wait_startup, and release it when we are ready to call
tpm_chip_register.

Cc: Christian Bundy <christianbundy@fraction.io>
Cc: Dan Williams <dan.j.williams@intel.com>
Cc: Peter Huewe <peterhuewe@gmx.de>
Cc: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Cc: Jason Gunthorpe <jgg@ziepe.ca>
Cc: Stefan Berger <stefanb@linux.vnet.ibm.com>
Cc: stable@vger.kernel.org
Cc: linux-intergrity@vger.kernel.org
Fixes: a3fbfae82b4c ("tpm: take TPM chip power gating out of tpm_transmit()")
Signed-off-by: Jerry Snitselaar <jsnitsel@redhat.com>
---
 drivers/char/tpm/tpm_tis_core.c | 17 +++++++----------
 1 file changed, 7 insertions(+), 10 deletions(-)

diff --git a/drivers/char/tpm/tpm_tis_core.c b/drivers/char/tpm/tpm_tis_core.c
index 8af2cee1a762..308756d278b3 100644
--- a/drivers/char/tpm/tpm_tis_core.c
+++ b/drivers/char/tpm/tpm_tis_core.c
@@ -978,13 +978,13 @@ int tpm_tis_core_init(struct device *dev, struct tpm_tis_data *priv, int irq,
 
 	if (wait_startup(chip, 0) != 0) {
 		rc = -ENODEV;
-		goto out_err;
+		goto out_start;
 	}
 
 	/* Take control of the TPM's interrupt hardware and shut it off */
 	rc = tpm_tis_read32(priv, TPM_INT_ENABLE(priv->locality), &intmask);
 	if (rc < 0)
-		goto out_err;
+		goto out_start;
 
 	intmask |= TPM_INTF_CMD_READY_INT | TPM_INTF_LOCALITY_CHANGE_INT |
 		   TPM_INTF_DATA_AVAIL_INT | TPM_INTF_STS_VALID_INT;
@@ -993,9 +993,8 @@ int tpm_tis_core_init(struct device *dev, struct tpm_tis_data *priv, int irq,
 
 	rc = tpm_chip_start(chip);
 	if (rc)
-		goto out_err;
+		goto out_start;
 	rc = tpm2_probe(chip);
-	tpm_chip_stop(chip);
 	if (rc)
 		goto out_err;
 
@@ -1059,7 +1058,6 @@ int tpm_tis_core_init(struct device *dev, struct tpm_tis_data *priv, int irq,
 			goto out_err;
 		}
 
-		tpm_chip_start(chip);
 		chip->flags |= TPM_CHIP_FLAG_IRQ;
 		if (irq) {
 			tpm_tis_probe_irq_single(chip, intmask, IRQF_SHARED,
@@ -1070,18 +1068,17 @@ int tpm_tis_core_init(struct device *dev, struct tpm_tis_data *priv, int irq,
 		} else {
 			tpm_tis_probe_irq(chip, intmask);
 		}
-		tpm_chip_stop(chip);
 	}
+	tpm_chip_stop(chip);
 
 	rc = tpm_chip_register(chip);
 	if (rc)
-		goto out_err;
-
-	if (chip->ops->clk_enable != NULL)
-		chip->ops->clk_enable(chip, false);
+		goto out_start;
 
 	return 0;
 out_err:
+	tpm_chip_stop(chip);
+out_start:
 	if ((chip->ops != NULL) && (chip->ops->clk_enable != NULL))
 		chip->ops->clk_enable(chip, false);
 
-- 
2.24.0


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

* Re: [PATCH] tpm_tis: reserve chip for duration of tpm_tis_core_init
  2019-12-11 23:17 [PATCH] tpm_tis: reserve chip for duration of tpm_tis_core_init Jerry Snitselaar
@ 2019-12-11 23:26 ` Jerry Snitselaar
  2019-12-11 23:30   ` Dan Williams
  2019-12-11 23:54 ` [PATCH v2] " Jerry Snitselaar
  2019-12-17  0:43 ` [PATCH] " Jarkko Sakkinen
  2 siblings, 1 reply; 26+ messages in thread
From: Jerry Snitselaar @ 2019-12-11 23:26 UTC (permalink / raw)
  To: linux-kernel
  Cc: Christian Bundy, Dan Williams, Peter Huewe, Jarkko Sakkinen,
	Jason Gunthorpe, Stefan Berger, stable, linux-integrity

On Wed Dec 11 19, Jerry Snitselaar wrote:
>Instead of repeatedly calling tpm_chip_start/tpm_chip_stop when
>issuing commands to the tpm during initialization, just reserve the
>chip after wait_startup, and release it when we are ready to call
>tpm_chip_register.
>
>Cc: Christian Bundy <christianbundy@fraction.io>
>Cc: Dan Williams <dan.j.williams@intel.com>
>Cc: Peter Huewe <peterhuewe@gmx.de>
>Cc: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
>Cc: Jason Gunthorpe <jgg@ziepe.ca>
>Cc: Stefan Berger <stefanb@linux.vnet.ibm.com>
>Cc: stable@vger.kernel.org
>Cc: linux-intergrity@vger.kernel.org

Typo on the list address, do you want me to resend Jarkko?

>Fixes: a3fbfae82b4c ("tpm: take TPM chip power gating out of tpm_transmit()")
>Signed-off-by: Jerry Snitselaar <jsnitsel@redhat.com>
>---

I did some initial testing with both a 1.2 device and a 2.0 device here.
Christian, can you verify that this still solves your timeouts problem
you were seeing? Dan, can you try this on the internal system with
the interrupt issues? I will see if I can get the t490s owner to run
it as well.

Thanks,
Jerry


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

* Re: [PATCH] tpm_tis: reserve chip for duration of tpm_tis_core_init
  2019-12-11 23:26 ` Jerry Snitselaar
@ 2019-12-11 23:30   ` Dan Williams
  2019-12-11 23:49     ` Jerry Snitselaar
  0 siblings, 1 reply; 26+ messages in thread
From: Dan Williams @ 2019-12-11 23:30 UTC (permalink / raw)
  To: Jerry Snitselaar, Linux Kernel Mailing List, Christian Bundy,
	Dan Williams, Peter Huewe, Jarkko Sakkinen, Jason Gunthorpe,
	Stefan Berger, stable, linux-integrity

On Wed, Dec 11, 2019 at 3:27 PM Jerry Snitselaar <jsnitsel@redhat.com> wrote:
>
> On Wed Dec 11 19, Jerry Snitselaar wrote:
> >Instead of repeatedly calling tpm_chip_start/tpm_chip_stop when
> >issuing commands to the tpm during initialization, just reserve the
> >chip after wait_startup, and release it when we are ready to call
> >tpm_chip_register.
> >
> >Cc: Christian Bundy <christianbundy@fraction.io>
> >Cc: Dan Williams <dan.j.williams@intel.com>
> >Cc: Peter Huewe <peterhuewe@gmx.de>
> >Cc: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
> >Cc: Jason Gunthorpe <jgg@ziepe.ca>
> >Cc: Stefan Berger <stefanb@linux.vnet.ibm.com>
> >Cc: stable@vger.kernel.org
> >Cc: linux-intergrity@vger.kernel.org
>
> Typo on the list address, do you want me to resend Jarkko?
>
> >Fixes: a3fbfae82b4c ("tpm: take TPM chip power gating out of tpm_transmit()")
> >Signed-off-by: Jerry Snitselaar <jsnitsel@redhat.com>
> >---
>
> I did some initial testing with both a 1.2 device and a 2.0 device here.
> Christian, can you verify that this still solves your timeouts problem
> you were seeing? Dan, can you try this on the internal system with
> the interrupt issues? I will see if I can get the t490s owner to run
> it as well.

Will do. I assume you'd also want to add 'Fixes: 5b359c7c4372
("tpm_tis_core: Turn on the TPM before probing IRQ's")' if it works?

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

* Re: [PATCH] tpm_tis: reserve chip for duration of tpm_tis_core_init
  2019-12-11 23:30   ` Dan Williams
@ 2019-12-11 23:49     ` Jerry Snitselaar
  0 siblings, 0 replies; 26+ messages in thread
From: Jerry Snitselaar @ 2019-12-11 23:49 UTC (permalink / raw)
  To: Dan Williams
  Cc: Linux Kernel Mailing List, Christian Bundy, Peter Huewe,
	Jarkko Sakkinen, Jason Gunthorpe, Stefan Berger, stable,
	linux-integrity

On Wed Dec 11 19, Dan Williams wrote:
>On Wed, Dec 11, 2019 at 3:27 PM Jerry Snitselaar <jsnitsel@redhat.com> wrote:
>>
>> On Wed Dec 11 19, Jerry Snitselaar wrote:
>> >Instead of repeatedly calling tpm_chip_start/tpm_chip_stop when
>> >issuing commands to the tpm during initialization, just reserve the
>> >chip after wait_startup, and release it when we are ready to call
>> >tpm_chip_register.
>> >
>> >Cc: Christian Bundy <christianbundy@fraction.io>
>> >Cc: Dan Williams <dan.j.williams@intel.com>
>> >Cc: Peter Huewe <peterhuewe@gmx.de>
>> >Cc: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
>> >Cc: Jason Gunthorpe <jgg@ziepe.ca>
>> >Cc: Stefan Berger <stefanb@linux.vnet.ibm.com>
>> >Cc: stable@vger.kernel.org
>> >Cc: linux-intergrity@vger.kernel.org
>>
>> Typo on the list address, do you want me to resend Jarkko?
>>
>> >Fixes: a3fbfae82b4c ("tpm: take TPM chip power gating out of tpm_transmit()")
>> >Signed-off-by: Jerry Snitselaar <jsnitsel@redhat.com>
>> >---
>>
>> I did some initial testing with both a 1.2 device and a 2.0 device here.
>> Christian, can you verify that this still solves your timeouts problem
>> you were seeing? Dan, can you try this on the internal system with
>> the interrupt issues? I will see if I can get the t490s owner to run
>> it as well.
>
>Will do. I assume you'd also want to add 'Fixes: 5b359c7c4372
>("tpm_tis_core: Turn on the TPM before probing IRQ's")' if it works?
>

Yes. I'm not certain this deals with the interrupt issue though, so
didn't want to stick it on there yet. I guess it should go on there
anyways since it is replacing that code. I'll post a v2.


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

* [PATCH v2] tpm_tis: reserve chip for duration of tpm_tis_core_init
  2019-12-11 23:17 [PATCH] tpm_tis: reserve chip for duration of tpm_tis_core_init Jerry Snitselaar
  2019-12-11 23:26 ` Jerry Snitselaar
@ 2019-12-11 23:54 ` Jerry Snitselaar
  2019-12-12  2:15   ` Dan Williams
  2019-12-17  0:58   ` Jarkko Sakkinen
  2019-12-17  0:43 ` [PATCH] " Jarkko Sakkinen
  2 siblings, 2 replies; 26+ messages in thread
From: Jerry Snitselaar @ 2019-12-11 23:54 UTC (permalink / raw)
  To: linux-kernel
  Cc: Christian Bundy, Dan Williams, Peter Huewe, Jarkko Sakkinen,
	Jason Gunthorpe, Stefan Berger, stable, linux-integrity

Instead of repeatedly calling tpm_chip_start/tpm_chip_stop when
issuing commands to the tpm during initialization, just reserve the
chip after wait_startup, and release it when we are ready to call
tpm_chip_register.

Cc: Christian Bundy <christianbundy@fraction.io>
Cc: Dan Williams <dan.j.williams@intel.com>
Cc: Peter Huewe <peterhuewe@gmx.de>
Cc: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Cc: Jason Gunthorpe <jgg@ziepe.ca>
Cc: Stefan Berger <stefanb@linux.vnet.ibm.com>
Cc: stable@vger.kernel.org
Cc: linux-integrity@vger.kernel.org
Fixes: a3fbfae82b4c ("tpm: take TPM chip power gating out of tpm_transmit()")
Fixes: 5b359c7c4372 ("tpm_tis_core: Turn on the TPM before probing IRQ's")
Signed-off-by: Jerry Snitselaar <jsnitsel@redhat.com>
---
v2: Fix integrity list address and add 5b359c7c4372 to fixes

 drivers/char/tpm/tpm_tis_core.c | 17 +++++++----------
 1 file changed, 7 insertions(+), 10 deletions(-)

diff --git a/drivers/char/tpm/tpm_tis_core.c b/drivers/char/tpm/tpm_tis_core.c
index 8af2cee1a762..308756d278b3 100644
--- a/drivers/char/tpm/tpm_tis_core.c
+++ b/drivers/char/tpm/tpm_tis_core.c
@@ -978,13 +978,13 @@ int tpm_tis_core_init(struct device *dev, struct tpm_tis_data *priv, int irq,
 
 	if (wait_startup(chip, 0) != 0) {
 		rc = -ENODEV;
-		goto out_err;
+		goto out_start;
 	}
 
 	/* Take control of the TPM's interrupt hardware and shut it off */
 	rc = tpm_tis_read32(priv, TPM_INT_ENABLE(priv->locality), &intmask);
 	if (rc < 0)
-		goto out_err;
+		goto out_start;
 
 	intmask |= TPM_INTF_CMD_READY_INT | TPM_INTF_LOCALITY_CHANGE_INT |
 		   TPM_INTF_DATA_AVAIL_INT | TPM_INTF_STS_VALID_INT;
@@ -993,9 +993,8 @@ int tpm_tis_core_init(struct device *dev, struct tpm_tis_data *priv, int irq,
 
 	rc = tpm_chip_start(chip);
 	if (rc)
-		goto out_err;
+		goto out_start;
 	rc = tpm2_probe(chip);
-	tpm_chip_stop(chip);
 	if (rc)
 		goto out_err;
 
@@ -1059,7 +1058,6 @@ int tpm_tis_core_init(struct device *dev, struct tpm_tis_data *priv, int irq,
 			goto out_err;
 		}
 
-		tpm_chip_start(chip);
 		chip->flags |= TPM_CHIP_FLAG_IRQ;
 		if (irq) {
 			tpm_tis_probe_irq_single(chip, intmask, IRQF_SHARED,
@@ -1070,18 +1068,17 @@ int tpm_tis_core_init(struct device *dev, struct tpm_tis_data *priv, int irq,
 		} else {
 			tpm_tis_probe_irq(chip, intmask);
 		}
-		tpm_chip_stop(chip);
 	}
+	tpm_chip_stop(chip);
 
 	rc = tpm_chip_register(chip);
 	if (rc)
-		goto out_err;
-
-	if (chip->ops->clk_enable != NULL)
-		chip->ops->clk_enable(chip, false);
+		goto out_start;
 
 	return 0;
 out_err:
+	tpm_chip_stop(chip);
+out_start:
 	if ((chip->ops != NULL) && (chip->ops->clk_enable != NULL))
 		chip->ops->clk_enable(chip, false);
 
-- 
2.24.0


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

* Re: [PATCH v2] tpm_tis: reserve chip for duration of tpm_tis_core_init
  2019-12-11 23:54 ` [PATCH v2] " Jerry Snitselaar
@ 2019-12-12  2:15   ` Dan Williams
  2019-12-12  2:18     ` Dan Williams
  2019-12-17  0:58   ` Jarkko Sakkinen
  1 sibling, 1 reply; 26+ messages in thread
From: Dan Williams @ 2019-12-12  2:15 UTC (permalink / raw)
  To: Jerry Snitselaar
  Cc: Linux Kernel Mailing List, Christian Bundy, Peter Huewe,
	Jarkko Sakkinen, Jason Gunthorpe, Stefan Berger, stable,
	linux-integrity

On Wed, Dec 11, 2019 at 3:56 PM Jerry Snitselaar <jsnitsel@redhat.com> wrote:
>
> Instead of repeatedly calling tpm_chip_start/tpm_chip_stop when
> issuing commands to the tpm during initialization, just reserve the
> chip after wait_startup, and release it when we are ready to call
> tpm_chip_register.
>
> Cc: Christian Bundy <christianbundy@fraction.io>
> Cc: Dan Williams <dan.j.williams@intel.com>
> Cc: Peter Huewe <peterhuewe@gmx.de>
> Cc: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
> Cc: Jason Gunthorpe <jgg@ziepe.ca>
> Cc: Stefan Berger <stefanb@linux.vnet.ibm.com>
> Cc: stable@vger.kernel.org
> Cc: linux-integrity@vger.kernel.org
> Fixes: a3fbfae82b4c ("tpm: take TPM chip power gating out of tpm_transmit()")
> Fixes: 5b359c7c4372 ("tpm_tis_core: Turn on the TPM before probing IRQ's")

Ugh, sorry, I guess this jinxed it. This patch does not address the
IRQ storm on the platform I reported earlier.

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

* Re: [PATCH v2] tpm_tis: reserve chip for duration of tpm_tis_core_init
  2019-12-12  2:15   ` Dan Williams
@ 2019-12-12  2:18     ` Dan Williams
  2019-12-17  1:25       ` Jarkko Sakkinen
  0 siblings, 1 reply; 26+ messages in thread
From: Dan Williams @ 2019-12-12  2:18 UTC (permalink / raw)
  To: Jerry Snitselaar
  Cc: Linux Kernel Mailing List, Christian Bundy, Peter Huewe,
	Jarkko Sakkinen, Jason Gunthorpe, Stefan Berger, stable,
	linux-integrity

On Wed, Dec 11, 2019 at 6:15 PM Dan Williams <dan.j.williams@intel.com> wrote:
>
> On Wed, Dec 11, 2019 at 3:56 PM Jerry Snitselaar <jsnitsel@redhat.com> wrote:
> >
> > Instead of repeatedly calling tpm_chip_start/tpm_chip_stop when
> > issuing commands to the tpm during initialization, just reserve the
> > chip after wait_startup, and release it when we are ready to call
> > tpm_chip_register.
> >
> > Cc: Christian Bundy <christianbundy@fraction.io>
> > Cc: Dan Williams <dan.j.williams@intel.com>
> > Cc: Peter Huewe <peterhuewe@gmx.de>
> > Cc: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
> > Cc: Jason Gunthorpe <jgg@ziepe.ca>
> > Cc: Stefan Berger <stefanb@linux.vnet.ibm.com>
> > Cc: stable@vger.kernel.org
> > Cc: linux-integrity@vger.kernel.org
> > Fixes: a3fbfae82b4c ("tpm: take TPM chip power gating out of tpm_transmit()")
> > Fixes: 5b359c7c4372 ("tpm_tis_core: Turn on the TPM before probing IRQ's")
>
> Ugh, sorry, I guess this jinxed it. This patch does not address the
> IRQ storm on the platform I reported earlier.

Are the reverts making their way upstream?

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

* Re: [PATCH] tpm_tis: reserve chip for duration of tpm_tis_core_init
  2019-12-11 23:17 [PATCH] tpm_tis: reserve chip for duration of tpm_tis_core_init Jerry Snitselaar
  2019-12-11 23:26 ` Jerry Snitselaar
  2019-12-11 23:54 ` [PATCH v2] " Jerry Snitselaar
@ 2019-12-17  0:43 ` Jarkko Sakkinen
  2 siblings, 0 replies; 26+ messages in thread
From: Jarkko Sakkinen @ 2019-12-17  0:43 UTC (permalink / raw)
  To: Jerry Snitselaar, linux-kernel
  Cc: Christian Bundy, Dan Williams, Peter Huewe, Jason Gunthorpe,
	Stefan Berger, stable, linux-intergrity

On Wed, 2019-12-11 at 16:17 -0700, Jerry Snitselaar wrote:
> Instead of repeatedly calling tpm_chip_start/tpm_chip_stop when
> issuing commands to the tpm during initialization, just reserve the
> chip after wait_startup, and release it when we are ready to call
> tpm_chip_register.
> 
> Cc: Christian Bundy <christianbundy@fraction.io>
> Cc: Dan Williams <dan.j.williams@intel.com>
> Cc: Peter Huewe <peterhuewe@gmx.de>
> Cc: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
> Cc: Jason Gunthorpe <jgg@ziepe.ca>
> Cc: Stefan Berger <stefanb@linux.vnet.ibm.com>
> Cc: stable@vger.kernel.org
> Cc: linux-intergrity@vger.kernel.org
> Fixes: a3fbfae82b4c ("tpm: take TPM chip power gating out of tpm_transmit()")
> Signed-off-by: Jerry Snitselaar <jsnitsel@redhat.com>

Sorry for the latency.

For me this looks good for putting to my rc3 PR with a minor twist:

1. Rename out_err as err_probe.
2. Rename out_start as err_start.

/Jarkko


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

* Re: [PATCH v2] tpm_tis: reserve chip for duration of tpm_tis_core_init
  2019-12-11 23:54 ` [PATCH v2] " Jerry Snitselaar
  2019-12-12  2:15   ` Dan Williams
@ 2019-12-17  0:58   ` Jarkko Sakkinen
  2019-12-17  1:18     ` Dan Williams
  2019-12-17  1:19     ` Jarkko Sakkinen
  1 sibling, 2 replies; 26+ messages in thread
From: Jarkko Sakkinen @ 2019-12-17  0:58 UTC (permalink / raw)
  To: Jerry Snitselaar, linux-kernel
  Cc: Christian Bundy, Dan Williams, Peter Huewe, Jason Gunthorpe,
	Stefan Berger, stable, linux-integrity

On Wed, 2019-12-11 at 16:54 -0700, Jerry Snitselaar wrote:
> Instead of repeatedly calling tpm_chip_start/tpm_chip_stop when
> issuing commands to the tpm during initialization, just reserve the
> chip after wait_startup, and release it when we are ready to call
> tpm_chip_register.
> 
> Cc: Christian Bundy <christianbundy@fraction.io>
> Cc: Dan Williams <dan.j.williams@intel.com>
> Cc: Peter Huewe <peterhuewe@gmx.de>
> Cc: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
> Cc: Jason Gunthorpe <jgg@ziepe.ca>
> Cc: Stefan Berger <stefanb@linux.vnet.ibm.com>
> Cc: stable@vger.kernel.org
> Cc: linux-integrity@vger.kernel.org
> Fixes: a3fbfae82b4c ("tpm: take TPM chip power gating out of tpm_transmit()")
> Fixes: 5b359c7c4372 ("tpm_tis_core: Turn on the TPM before probing IRQ's")
> Signed-off-by: Jerry Snitselaar <jsnitsel@redhat.com>

I pushed to my master with minor tweaks and added my tags.

Please check before I put it to linux-next.

/Jarkko


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

* Re: [PATCH v2] tpm_tis: reserve chip for duration of tpm_tis_core_init
  2019-12-17  0:58   ` Jarkko Sakkinen
@ 2019-12-17  1:18     ` Dan Williams
  2019-12-17  2:00       ` Jerry Snitselaar
  2019-12-17  1:19     ` Jarkko Sakkinen
  1 sibling, 1 reply; 26+ messages in thread
From: Dan Williams @ 2019-12-17  1:18 UTC (permalink / raw)
  To: Jarkko Sakkinen
  Cc: Jerry Snitselaar, Linux Kernel Mailing List, Christian Bundy,
	Peter Huewe, Jason Gunthorpe, Stefan Berger, stable,
	linux-integrity

On Mon, Dec 16, 2019 at 4:59 PM Jarkko Sakkinen
<jarkko.sakkinen@linux.intel.com> wrote:
>
> On Wed, 2019-12-11 at 16:54 -0700, Jerry Snitselaar wrote:
> > Instead of repeatedly calling tpm_chip_start/tpm_chip_stop when
> > issuing commands to the tpm during initialization, just reserve the
> > chip after wait_startup, and release it when we are ready to call
> > tpm_chip_register.
> >
> > Cc: Christian Bundy <christianbundy@fraction.io>
> > Cc: Dan Williams <dan.j.williams@intel.com>
> > Cc: Peter Huewe <peterhuewe@gmx.de>
> > Cc: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
> > Cc: Jason Gunthorpe <jgg@ziepe.ca>
> > Cc: Stefan Berger <stefanb@linux.vnet.ibm.com>
> > Cc: stable@vger.kernel.org
> > Cc: linux-integrity@vger.kernel.org
> > Fixes: a3fbfae82b4c ("tpm: take TPM chip power gating out of tpm_transmit()")
> > Fixes: 5b359c7c4372 ("tpm_tis_core: Turn on the TPM before probing IRQ's")
> > Signed-off-by: Jerry Snitselaar <jsnitsel@redhat.com>
>
> I pushed to my master with minor tweaks and added my tags.
>
> Please check before I put it to linux-next.

I don't see it yet here:

http://git.infradead.org/users/jjs/linux-tpmdd.git/shortlog/refs/heads/master

However, I wanted to make sure you captured that this does *not* fix
the interrupt issue. I.e. make sure you remove the "Fixes:
5b359c7c4372 ("tpm_tis_core: Turn on the TPM before probing IRQ's")"
tag.

With that said, are you going to include the revert of:

1ea32c83c699 tpm_tis_core: Set TPM_CHIP_FLAG_IRQ before probing for interrupts
5b359c7c4372 tpm_tis_core: Turn on the TPM before probing IRQ's

...in your -rc3 pull?

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

* Re: [PATCH v2] tpm_tis: reserve chip for duration of tpm_tis_core_init
  2019-12-17  0:58   ` Jarkko Sakkinen
  2019-12-17  1:18     ` Dan Williams
@ 2019-12-17  1:19     ` Jarkko Sakkinen
  1 sibling, 0 replies; 26+ messages in thread
From: Jarkko Sakkinen @ 2019-12-17  1:19 UTC (permalink / raw)
  To: Jerry Snitselaar, linux-kernel
  Cc: Christian Bundy, Dan Williams, Peter Huewe, Jason Gunthorpe,
	Stefan Berger, stable, linux-integrity

On Tue, 2019-12-17 at 02:58 +0200, Jarkko Sakkinen wrote:
> On Wed, 2019-12-11 at 16:54 -0700, Jerry Snitselaar wrote:
> > Instead of repeatedly calling tpm_chip_start/tpm_chip_stop when
> > issuing commands to the tpm during initialization, just reserve the
> > chip after wait_startup, and release it when we are ready to call
> > tpm_chip_register.
> > 
> > Cc: Christian Bundy <christianbundy@fraction.io>
> > Cc: Dan Williams <dan.j.williams@intel.com>
> > Cc: Peter Huewe <peterhuewe@gmx.de>
> > Cc: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
> > Cc: Jason Gunthorpe <jgg@ziepe.ca>
> > Cc: Stefan Berger <stefanb@linux.vnet.ibm.com>
> > Cc: stable@vger.kernel.org
> > Cc: linux-integrity@vger.kernel.org
> > Fixes: a3fbfae82b4c ("tpm: take TPM chip power gating out of tpm_transmit()")
> > Fixes: 5b359c7c4372 ("tpm_tis_core: Turn on the TPM before probing IRQ's")
> > Signed-off-by: Jerry Snitselaar <jsnitsel@redhat.com>
> 
> I pushed to my master with minor tweaks and added my tags.
> 
> Please check before I put it to linux-next.

Oops. Forgot to push please check now

git://git.infradead.org/users/jjs/linux-tpmdd.git master

/Jarkko



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

* Re: [PATCH v2] tpm_tis: reserve chip for duration of tpm_tis_core_init
  2019-12-12  2:18     ` Dan Williams
@ 2019-12-17  1:25       ` Jarkko Sakkinen
  0 siblings, 0 replies; 26+ messages in thread
From: Jarkko Sakkinen @ 2019-12-17  1:25 UTC (permalink / raw)
  To: Dan Williams, Jerry Snitselaar
  Cc: Linux Kernel Mailing List, Christian Bundy, Peter Huewe,
	Jason Gunthorpe, Stefan Berger, stable, linux-integrity

On Wed, 2019-12-11 at 18:18 -0800, Dan Williams wrote:
> On Wed, Dec 11, 2019 at 6:15 PM Dan Williams <dan.j.williams@intel.com> wrote:
> > On Wed, Dec 11, 2019 at 3:56 PM Jerry Snitselaar <jsnitsel@redhat.com> wrote:
> > > Instead of repeatedly calling tpm_chip_start/tpm_chip_stop when
> > > issuing commands to the tpm during initialization, just reserve the
> > > chip after wait_startup, and release it when we are ready to call
> > > tpm_chip_register.
> > > 
> > > Cc: Christian Bundy <christianbundy@fraction.io>
> > > Cc: Dan Williams <dan.j.williams@intel.com>
> > > Cc: Peter Huewe <peterhuewe@gmx.de>
> > > Cc: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
> > > Cc: Jason Gunthorpe <jgg@ziepe.ca>
> > > Cc: Stefan Berger <stefanb@linux.vnet.ibm.com>
> > > Cc: stable@vger.kernel.org
> > > Cc: linux-integrity@vger.kernel.org
> > > Fixes: a3fbfae82b4c ("tpm: take TPM chip power gating out of tpm_transmit()")
> > > Fixes: 5b359c7c4372 ("tpm_tis_core: Turn on the TPM before probing IRQ's")
> > 
> > Ugh, sorry, I guess this jinxed it. This patch does not address the
> > IRQ storm on the platform I reported earlier.
> 
> Are the reverts making their way upstream?

Not yet.

Cannot randomly apply patches without answer to why. Given that
some changes are already landed changes it would be better to
create a patch based on reverts (in the sense of code change)
and commit message what is going on.

/Jarkko


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

* Re: [PATCH v2] tpm_tis: reserve chip for duration of tpm_tis_core_init
  2019-12-17  1:18     ` Dan Williams
@ 2019-12-17  2:00       ` Jerry Snitselaar
  2019-12-17  2:14         ` Dan Williams
  0 siblings, 1 reply; 26+ messages in thread
From: Jerry Snitselaar @ 2019-12-17  2:00 UTC (permalink / raw)
  To: Dan Williams
  Cc: Jarkko Sakkinen, Linux Kernel Mailing List, Christian Bundy,
	Peter Huewe, Jason Gunthorpe, Stefan Berger, stable,
	linux-integrity

On Mon Dec 16 19, Dan Williams wrote:
>On Mon, Dec 16, 2019 at 4:59 PM Jarkko Sakkinen
><jarkko.sakkinen@linux.intel.com> wrote:
>>
>> On Wed, 2019-12-11 at 16:54 -0700, Jerry Snitselaar wrote:
>> > Instead of repeatedly calling tpm_chip_start/tpm_chip_stop when
>> > issuing commands to the tpm during initialization, just reserve the
>> > chip after wait_startup, and release it when we are ready to call
>> > tpm_chip_register.
>> >
>> > Cc: Christian Bundy <christianbundy@fraction.io>
>> > Cc: Dan Williams <dan.j.williams@intel.com>
>> > Cc: Peter Huewe <peterhuewe@gmx.de>
>> > Cc: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
>> > Cc: Jason Gunthorpe <jgg@ziepe.ca>
>> > Cc: Stefan Berger <stefanb@linux.vnet.ibm.com>
>> > Cc: stable@vger.kernel.org
>> > Cc: linux-integrity@vger.kernel.org
>> > Fixes: a3fbfae82b4c ("tpm: take TPM chip power gating out of tpm_transmit()")
>> > Fixes: 5b359c7c4372 ("tpm_tis_core: Turn on the TPM before probing IRQ's")
>> > Signed-off-by: Jerry Snitselaar <jsnitsel@redhat.com>
>>
>> I pushed to my master with minor tweaks and added my tags.
>>
>> Please check before I put it to linux-next.
>
>I don't see it yet here:
>
>http://git.infradead.org/users/jjs/linux-tpmdd.git/shortlog/refs/heads/master
>
>However, I wanted to make sure you captured that this does *not* fix
>the interrupt issue. I.e. make sure you remove the "Fixes:
>5b359c7c4372 ("tpm_tis_core: Turn on the TPM before probing IRQ's")"
>tag.
>
>With that said, are you going to include the revert of:
>
>1ea32c83c699 tpm_tis_core: Set TPM_CHIP_FLAG_IRQ before probing for interrupts

Dan, with the above reverted do you still get the screaming interrupt?

>5b359c7c4372 tpm_tis_core: Turn on the TPM before probing IRQ's
>
>...in your -rc3 pull?
>


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

* Re: [PATCH v2] tpm_tis: reserve chip for duration of tpm_tis_core_init
  2019-12-17  2:00       ` Jerry Snitselaar
@ 2019-12-17  2:14         ` Dan Williams
  2019-12-17 12:05           ` Jarkko Sakkinen
  0 siblings, 1 reply; 26+ messages in thread
From: Dan Williams @ 2019-12-17  2:14 UTC (permalink / raw)
  To: Jerry Snitselaar, Dan Williams, Jarkko Sakkinen,
	Linux Kernel Mailing List, Christian Bundy, Peter Huewe,
	Jason Gunthorpe, Stefan Berger, stable, linux-integrity

On Mon, Dec 16, 2019 at 6:00 PM Jerry Snitselaar <jsnitsel@redhat.com> wrote:
>
> On Mon Dec 16 19, Dan Williams wrote:
> >On Mon, Dec 16, 2019 at 4:59 PM Jarkko Sakkinen
> ><jarkko.sakkinen@linux.intel.com> wrote:
> >>
> >> On Wed, 2019-12-11 at 16:54 -0700, Jerry Snitselaar wrote:
> >> > Instead of repeatedly calling tpm_chip_start/tpm_chip_stop when
> >> > issuing commands to the tpm during initialization, just reserve the
> >> > chip after wait_startup, and release it when we are ready to call
> >> > tpm_chip_register.
> >> >
> >> > Cc: Christian Bundy <christianbundy@fraction.io>
> >> > Cc: Dan Williams <dan.j.williams@intel.com>
> >> > Cc: Peter Huewe <peterhuewe@gmx.de>
> >> > Cc: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
> >> > Cc: Jason Gunthorpe <jgg@ziepe.ca>
> >> > Cc: Stefan Berger <stefanb@linux.vnet.ibm.com>
> >> > Cc: stable@vger.kernel.org
> >> > Cc: linux-integrity@vger.kernel.org
> >> > Fixes: a3fbfae82b4c ("tpm: take TPM chip power gating out of tpm_transmit()")
> >> > Fixes: 5b359c7c4372 ("tpm_tis_core: Turn on the TPM before probing IRQ's")
> >> > Signed-off-by: Jerry Snitselaar <jsnitsel@redhat.com>
> >>
> >> I pushed to my master with minor tweaks and added my tags.
> >>
> >> Please check before I put it to linux-next.
> >
> >I don't see it yet here:
> >
> >http://git.infradead.org/users/jjs/linux-tpmdd.git/shortlog/refs/heads/master
> >
> >However, I wanted to make sure you captured that this does *not* fix
> >the interrupt issue. I.e. make sure you remove the "Fixes:
> >5b359c7c4372 ("tpm_tis_core: Turn on the TPM before probing IRQ's")"
> >tag.
> >
> >With that said, are you going to include the revert of:
> >
> >1ea32c83c699 tpm_tis_core: Set TPM_CHIP_FLAG_IRQ before probing for interrupts
>
> Dan, with the above reverted do you still get the screaming interrupt?

Yes, the screaming interrupt goes away, although it is replaced by
these messages when the driver starts:

[    3.725131] tpm_tis IFX0740:00: 2.0 TPM (device-id 0x1B, rev-id 16)
[    3.725358] tpm tpm0: tpm_try_transmit: send(): error -5
[    3.725359] tpm tpm0: [Firmware Bug]: TPM interrupt not working,
polling instead

If the choice is "error message + polled-mode" vs "pinning a cpu with
interrupts" I'd accept the former, but wanted Jarkko with his
maintainer hat to weigh in.

Is there a simple sanity check I can run to see if the TPM is still
operational in this state?

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

* Re: [PATCH v2] tpm_tis: reserve chip for duration of tpm_tis_core_init
  2019-12-17  2:14         ` Dan Williams
@ 2019-12-17 12:05           ` Jarkko Sakkinen
  2019-12-17 17:18             ` Jerry Snitselaar
  2019-12-17 20:29             ` Jerry Snitselaar
  0 siblings, 2 replies; 26+ messages in thread
From: Jarkko Sakkinen @ 2019-12-17 12:05 UTC (permalink / raw)
  To: Dan Williams, Jerry Snitselaar, Linux Kernel Mailing List,
	Christian Bundy, Peter Huewe, Jason Gunthorpe, Stefan Berger,
	stable, linux-integrity

On Mon, 2019-12-16 at 18:14 -0800, Dan Williams wrote:
> On Mon, Dec 16, 2019 at 6:00 PM Jerry Snitselaar <jsnitsel@redhat.com> wrote:
> > On Mon Dec 16 19, Dan Williams wrote:
> > > On Mon, Dec 16, 2019 at 4:59 PM Jarkko Sakkinen
> > > <jarkko.sakkinen@linux.intel.com> wrote:
> > > > On Wed, 2019-12-11 at 16:54 -0700, Jerry Snitselaar wrote:
> > > > > Instead of repeatedly calling tpm_chip_start/tpm_chip_stop when
> > > > > issuing commands to the tpm during initialization, just reserve the
> > > > > chip after wait_startup, and release it when we are ready to call
> > > > > tpm_chip_register.
> > > > > 
> > > > > Cc: Christian Bundy <christianbundy@fraction.io>
> > > > > Cc: Dan Williams <dan.j.williams@intel.com>
> > > > > Cc: Peter Huewe <peterhuewe@gmx.de>
> > > > > Cc: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
> > > > > Cc: Jason Gunthorpe <jgg@ziepe.ca>
> > > > > Cc: Stefan Berger <stefanb@linux.vnet.ibm.com>
> > > > > Cc: stable@vger.kernel.org
> > > > > Cc: linux-integrity@vger.kernel.org
> > > > > Fixes: a3fbfae82b4c ("tpm: take TPM chip power gating out of tpm_transmit()")
> > > > > Fixes: 5b359c7c4372 ("tpm_tis_core: Turn on the TPM before probing IRQ's")
> > > > > Signed-off-by: Jerry Snitselaar <jsnitsel@redhat.com>
> > > > 
> > > > I pushed to my master with minor tweaks and added my tags.
> > > > 
> > > > Please check before I put it to linux-next.
> > > 
> > > I don't see it yet here:
> > > 
> > > http://git.infradead.org/users/jjs/linux-tpmdd.git/shortlog/refs/heads/master
> > > 
> > > However, I wanted to make sure you captured that this does *not* fix
> > > the interrupt issue. I.e. make sure you remove the "Fixes:
> > > 5b359c7c4372 ("tpm_tis_core: Turn on the TPM before probing IRQ's")"
> > > tag.
> > > 
> > > With that said, are you going to include the revert of:
> > > 
> > > 1ea32c83c699 tpm_tis_core: Set TPM_CHIP_FLAG_IRQ before probing for interrupts
> > 
> > Dan, with the above reverted do you still get the screaming interrupt?
> 
> Yes, the screaming interrupt goes away, although it is replaced by
> these messages when the driver starts:
> 
> [    3.725131] tpm_tis IFX0740:00: 2.0 TPM (device-id 0x1B, rev-id 16)
> [    3.725358] tpm tpm0: tpm_try_transmit: send(): error -5
> [    3.725359] tpm tpm0: [Firmware Bug]: TPM interrupt not working,
> polling instead
> 
> If the choice is "error message + polled-mode" vs "pinning a cpu with
> interrupts" I'd accept the former, but wanted Jarkko with his
> maintainer hat to weigh in.
> 
> Is there a simple sanity check I can run to see if the TPM is still
> operational in this state?

What about T490S?

/Jarkko


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

* Re: [PATCH v2] tpm_tis: reserve chip for duration of tpm_tis_core_init
  2019-12-17 12:05           ` Jarkko Sakkinen
@ 2019-12-17 17:18             ` Jerry Snitselaar
  2019-12-17 17:26               ` Jerry Snitselaar
  2019-12-18 23:06               ` Jarkko Sakkinen
  2019-12-17 20:29             ` Jerry Snitselaar
  1 sibling, 2 replies; 26+ messages in thread
From: Jerry Snitselaar @ 2019-12-17 17:18 UTC (permalink / raw)
  To: Jarkko Sakkinen
  Cc: Dan Williams, Linux Kernel Mailing List, Christian Bundy,
	Peter Huewe, Jason Gunthorpe, Stefan Berger, stable,
	linux-integrity

On Tue Dec 17 19, Jarkko Sakkinen wrote:
>On Mon, 2019-12-16 at 18:14 -0800, Dan Williams wrote:
>> On Mon, Dec 16, 2019 at 6:00 PM Jerry Snitselaar <jsnitsel@redhat.com> wrote:
>> > On Mon Dec 16 19, Dan Williams wrote:
>> > > On Mon, Dec 16, 2019 at 4:59 PM Jarkko Sakkinen
>> > > <jarkko.sakkinen@linux.intel.com> wrote:
>> > > > On Wed, 2019-12-11 at 16:54 -0700, Jerry Snitselaar wrote:
>> > > > > Instead of repeatedly calling tpm_chip_start/tpm_chip_stop when
>> > > > > issuing commands to the tpm during initialization, just reserve the
>> > > > > chip after wait_startup, and release it when we are ready to call
>> > > > > tpm_chip_register.
>> > > > >
>> > > > > Cc: Christian Bundy <christianbundy@fraction.io>
>> > > > > Cc: Dan Williams <dan.j.williams@intel.com>
>> > > > > Cc: Peter Huewe <peterhuewe@gmx.de>
>> > > > > Cc: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
>> > > > > Cc: Jason Gunthorpe <jgg@ziepe.ca>
>> > > > > Cc: Stefan Berger <stefanb@linux.vnet.ibm.com>
>> > > > > Cc: stable@vger.kernel.org
>> > > > > Cc: linux-integrity@vger.kernel.org
>> > > > > Fixes: a3fbfae82b4c ("tpm: take TPM chip power gating out of tpm_transmit()")
>> > > > > Fixes: 5b359c7c4372 ("tpm_tis_core: Turn on the TPM before probing IRQ's")
>> > > > > Signed-off-by: Jerry Snitselaar <jsnitsel@redhat.com>
>> > > >
>> > > > I pushed to my master with minor tweaks and added my tags.
>> > > >
>> > > > Please check before I put it to linux-next.
>> > >
>> > > I don't see it yet here:
>> > >
>> > > http://git.infradead.org/users/jjs/linux-tpmdd.git/shortlog/refs/heads/master
>> > >
>> > > However, I wanted to make sure you captured that this does *not* fix
>> > > the interrupt issue. I.e. make sure you remove the "Fixes:
>> > > 5b359c7c4372 ("tpm_tis_core: Turn on the TPM before probing IRQ's")"
>> > > tag.
>> > >
>> > > With that said, are you going to include the revert of:
>> > >
>> > > 1ea32c83c699 tpm_tis_core: Set TPM_CHIP_FLAG_IRQ before probing for interrupts
>> >
>> > Dan, with the above reverted do you still get the screaming interrupt?
>>
>> Yes, the screaming interrupt goes away, although it is replaced by
>> these messages when the driver starts:
>>
>> [    3.725131] tpm_tis IFX0740:00: 2.0 TPM (device-id 0x1B, rev-id 16)
>> [    3.725358] tpm tpm0: tpm_try_transmit: send(): error -5
>> [    3.725359] tpm tpm0: [Firmware Bug]: TPM interrupt not working,
>> polling instead
>>
>> If the choice is "error message + polled-mode" vs "pinning a cpu with
>> interrupts" I'd accept the former, but wanted Jarkko with his
>> maintainer hat to weigh in.
>>
>> Is there a simple sanity check I can run to see if the TPM is still
>> operational in this state?
>
>What about T490S?
>
>/Jarkko
>

Hi Jarkko, I'm waiting to hear back from the t490s user, but I imagine
it still has the problem as well.

Christian, were you able to try this patch and verify it still
resolves the issue you were having with the kernel failing to get the
timeouts and durations from the tpm?

Thanks,
Jerry


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

* Re: [PATCH v2] tpm_tis: reserve chip for duration of tpm_tis_core_init
  2019-12-17 17:18             ` Jerry Snitselaar
@ 2019-12-17 17:26               ` Jerry Snitselaar
  2019-12-18 23:09                 ` Jarkko Sakkinen
  2019-12-18 23:06               ` Jarkko Sakkinen
  1 sibling, 1 reply; 26+ messages in thread
From: Jerry Snitselaar @ 2019-12-17 17:26 UTC (permalink / raw)
  To: Jarkko Sakkinen, Dan Williams, Linux Kernel Mailing List,
	Christian Bundy, Peter Huewe, Jason Gunthorpe, Stefan Berger,
	stable, linux-integrity

On Tue Dec 17 19, Jerry Snitselaar wrote:
>On Tue Dec 17 19, Jarkko Sakkinen wrote:
>>On Mon, 2019-12-16 at 18:14 -0800, Dan Williams wrote:
>>>On Mon, Dec 16, 2019 at 6:00 PM Jerry Snitselaar <jsnitsel@redhat.com> wrote:
>>>> On Mon Dec 16 19, Dan Williams wrote:
>>>> > On Mon, Dec 16, 2019 at 4:59 PM Jarkko Sakkinen
>>>> > <jarkko.sakkinen@linux.intel.com> wrote:
>>>> > > On Wed, 2019-12-11 at 16:54 -0700, Jerry Snitselaar wrote:
>>>> > > > Instead of repeatedly calling tpm_chip_start/tpm_chip_stop when
>>>> > > > issuing commands to the tpm during initialization, just reserve the
>>>> > > > chip after wait_startup, and release it when we are ready to call
>>>> > > > tpm_chip_register.
>>>> > > >
>>>> > > > Cc: Christian Bundy <christianbundy@fraction.io>
>>>> > > > Cc: Dan Williams <dan.j.williams@intel.com>
>>>> > > > Cc: Peter Huewe <peterhuewe@gmx.de>
>>>> > > > Cc: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
>>>> > > > Cc: Jason Gunthorpe <jgg@ziepe.ca>
>>>> > > > Cc: Stefan Berger <stefanb@linux.vnet.ibm.com>
>>>> > > > Cc: stable@vger.kernel.org
>>>> > > > Cc: linux-integrity@vger.kernel.org
>>>> > > > Fixes: a3fbfae82b4c ("tpm: take TPM chip power gating out of tpm_transmit()")
>>>> > > > Fixes: 5b359c7c4372 ("tpm_tis_core: Turn on the TPM before probing IRQ's")
>>>> > > > Signed-off-by: Jerry Snitselaar <jsnitsel@redhat.com>
>>>> > >
>>>> > > I pushed to my master with minor tweaks and added my tags.
>>>> > >
>>>> > > Please check before I put it to linux-next.
>>>> >
>>>> > I don't see it yet here:
>>>> >
>>>> > http://git.infradead.org/users/jjs/linux-tpmdd.git/shortlog/refs/heads/master
>>>> >
>>>> > However, I wanted to make sure you captured that this does *not* fix
>>>> > the interrupt issue. I.e. make sure you remove the "Fixes:
>>>> > 5b359c7c4372 ("tpm_tis_core: Turn on the TPM before probing IRQ's")"
>>>> > tag.
>>>> >
>>>> > With that said, are you going to include the revert of:
>>>> >
>>>> > 1ea32c83c699 tpm_tis_core: Set TPM_CHIP_FLAG_IRQ before probing for interrupts
>>>>
>>>> Dan, with the above reverted do you still get the screaming interrupt?
>>>
>>>Yes, the screaming interrupt goes away, although it is replaced by
>>>these messages when the driver starts:
>>>
>>>[    3.725131] tpm_tis IFX0740:00: 2.0 TPM (device-id 0x1B, rev-id 16)
>>>[    3.725358] tpm tpm0: tpm_try_transmit: send(): error -5
>>>[    3.725359] tpm tpm0: [Firmware Bug]: TPM interrupt not working,
>>>polling instead
>>>
>>>If the choice is "error message + polled-mode" vs "pinning a cpu with
>>>interrupts" I'd accept the former, but wanted Jarkko with his
>>>maintainer hat to weigh in.
>>>
>>>Is there a simple sanity check I can run to see if the TPM is still
>>>operational in this state?
>>
>>What about T490S?
>>
>>/Jarkko
>>
>
>Hi Jarkko, I'm waiting to hear back from the t490s user, but I imagine
>it still has the problem as well.
>

It appears he is out of the office until January, so I doubt I will hear
anything back until then.

>Christian, were you able to try this patch and verify it still
>resolves the issue you were having with the kernel failing to get the
>timeouts and durations from the tpm?
>
>Thanks,
>Jerry


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

* Re: [PATCH v2] tpm_tis: reserve chip for duration of tpm_tis_core_init
  2019-12-17 12:05           ` Jarkko Sakkinen
  2019-12-17 17:18             ` Jerry Snitselaar
@ 2019-12-17 20:29             ` Jerry Snitselaar
  2019-12-18 23:12               ` Jarkko Sakkinen
  1 sibling, 1 reply; 26+ messages in thread
From: Jerry Snitselaar @ 2019-12-17 20:29 UTC (permalink / raw)
  To: Jarkko Sakkinen
  Cc: Dan Williams, Linux Kernel Mailing List, Christian Bundy,
	Peter Huewe, Jason Gunthorpe, Stefan Berger, stable,
	linux-integrity

On Tue Dec 17 19, Jarkko Sakkinen wrote:
>On Mon, 2019-12-16 at 18:14 -0800, Dan Williams wrote:
>> On Mon, Dec 16, 2019 at 6:00 PM Jerry Snitselaar <jsnitsel@redhat.com> wrote:
>> > On Mon Dec 16 19, Dan Williams wrote:
>> > > On Mon, Dec 16, 2019 at 4:59 PM Jarkko Sakkinen
>> > > <jarkko.sakkinen@linux.intel.com> wrote:
>> > > > On Wed, 2019-12-11 at 16:54 -0700, Jerry Snitselaar wrote:
>> > > > > Instead of repeatedly calling tpm_chip_start/tpm_chip_stop when
>> > > > > issuing commands to the tpm during initialization, just reserve the
>> > > > > chip after wait_startup, and release it when we are ready to call
>> > > > > tpm_chip_register.
>> > > > >
>> > > > > Cc: Christian Bundy <christianbundy@fraction.io>
>> > > > > Cc: Dan Williams <dan.j.williams@intel.com>
>> > > > > Cc: Peter Huewe <peterhuewe@gmx.de>
>> > > > > Cc: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
>> > > > > Cc: Jason Gunthorpe <jgg@ziepe.ca>
>> > > > > Cc: Stefan Berger <stefanb@linux.vnet.ibm.com>
>> > > > > Cc: stable@vger.kernel.org
>> > > > > Cc: linux-integrity@vger.kernel.org
>> > > > > Fixes: a3fbfae82b4c ("tpm: take TPM chip power gating out of tpm_transmit()")
>> > > > > Fixes: 5b359c7c4372 ("tpm_tis_core: Turn on the TPM before probing IRQ's")
>> > > > > Signed-off-by: Jerry Snitselaar <jsnitsel@redhat.com>
>> > > >
>> > > > I pushed to my master with minor tweaks and added my tags.
>> > > >
>> > > > Please check before I put it to linux-next.
>> > >
>> > > I don't see it yet here:
>> > >
>> > > http://git.infradead.org/users/jjs/linux-tpmdd.git/shortlog/refs/heads/master
>> > >
>> > > However, I wanted to make sure you captured that this does *not* fix
>> > > the interrupt issue. I.e. make sure you remove the "Fixes:
>> > > 5b359c7c4372 ("tpm_tis_core: Turn on the TPM before probing IRQ's")"
>> > > tag.
>> > >
>> > > With that said, are you going to include the revert of:
>> > >
>> > > 1ea32c83c699 tpm_tis_core: Set TPM_CHIP_FLAG_IRQ before probing for interrupts
>> >
>> > Dan, with the above reverted do you still get the screaming interrupt?
>>
>> Yes, the screaming interrupt goes away, although it is replaced by
>> these messages when the driver starts:
>>
>> [    3.725131] tpm_tis IFX0740:00: 2.0 TPM (device-id 0x1B, rev-id 16)
>> [    3.725358] tpm tpm0: tpm_try_transmit: send(): error -5
>> [    3.725359] tpm tpm0: [Firmware Bug]: TPM interrupt not working,
>> polling instead
>>
>> If the choice is "error message + polled-mode" vs "pinning a cpu with
>> interrupts" I'd accept the former, but wanted Jarkko with his
>> maintainer hat to weigh in.
>>
>> Is there a simple sanity check I can run to see if the TPM is still
>> operational in this state?
>
>What about T490S?
>
>/Jarkko
>

I just heard back from the t490s user, and as expected the problem still exists
there with this patch.

Regards,
Jerry


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

* Re: [PATCH v2] tpm_tis: reserve chip for duration of tpm_tis_core_init
  2019-12-17 17:18             ` Jerry Snitselaar
  2019-12-17 17:26               ` Jerry Snitselaar
@ 2019-12-18 23:06               ` Jarkko Sakkinen
  2019-12-18 23:31                 ` Dan Williams
  1 sibling, 1 reply; 26+ messages in thread
From: Jarkko Sakkinen @ 2019-12-18 23:06 UTC (permalink / raw)
  To: Jerry Snitselaar
  Cc: Dan Williams, Linux Kernel Mailing List, Christian Bundy,
	Peter Huewe, Jason Gunthorpe, Stefan Berger, stable,
	linux-integrity

On Tue, 2019-12-17 at 10:18 -0700, Jerry Snitselaar wrote:
> On Tue Dec 17 19, Jarkko Sakkinen wrote:
> > On Mon, 2019-12-16 at 18:14 -0800, Dan Williams wrote:
> > > On Mon, Dec 16, 2019 at 6:00 PM Jerry Snitselaar <jsnitsel@redhat.com> wrote:
> > > > On Mon Dec 16 19, Dan Williams wrote:
> > > > > On Mon, Dec 16, 2019 at 4:59 PM Jarkko Sakkinen
> > > > > <jarkko.sakkinen@linux.intel.com> wrote:
> > > > > > On Wed, 2019-12-11 at 16:54 -0700, Jerry Snitselaar wrote:
> > > > > > > Instead of repeatedly calling tpm_chip_start/tpm_chip_stop when
> > > > > > > issuing commands to the tpm during initialization, just reserve the
> > > > > > > chip after wait_startup, and release it when we are ready to call
> > > > > > > tpm_chip_register.
> > > > > > > 
> > > > > > > Cc: Christian Bundy <christianbundy@fraction.io>
> > > > > > > Cc: Dan Williams <dan.j.williams@intel.com>
> > > > > > > Cc: Peter Huewe <peterhuewe@gmx.de>
> > > > > > > Cc: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
> > > > > > > Cc: Jason Gunthorpe <jgg@ziepe.ca>
> > > > > > > Cc: Stefan Berger <stefanb@linux.vnet.ibm.com>
> > > > > > > Cc: stable@vger.kernel.org
> > > > > > > Cc: linux-integrity@vger.kernel.org
> > > > > > > Fixes: a3fbfae82b4c ("tpm: take TPM chip power gating out of tpm_transmit()")
> > > > > > > Fixes: 5b359c7c4372 ("tpm_tis_core: Turn on the TPM before probing IRQ's")
> > > > > > > Signed-off-by: Jerry Snitselaar <jsnitsel@redhat.com>
> > > > > > 
> > > > > > I pushed to my master with minor tweaks and added my tags.
> > > > > > 
> > > > > > Please check before I put it to linux-next.
> > > > > 
> > > > > I don't see it yet here:
> > > > > 
> > > > > http://git.infradead.org/users/jjs/linux-tpmdd.git/shortlog/refs/heads/master
> > > > > 
> > > > > However, I wanted to make sure you captured that this does *not* fix
> > > > > the interrupt issue. I.e. make sure you remove the "Fixes:
> > > > > 5b359c7c4372 ("tpm_tis_core: Turn on the TPM before probing IRQ's")"
> > > > > tag.
> > > > > 
> > > > > With that said, are you going to include the revert of:
> > > > > 
> > > > > 1ea32c83c699 tpm_tis_core: Set TPM_CHIP_FLAG_IRQ before probing for interrupts
> > > > 
> > > > Dan, with the above reverted do you still get the screaming interrupt?
> > > 
> > > Yes, the screaming interrupt goes away, although it is replaced by
> > > these messages when the driver starts:
> > > 
> > > [    3.725131] tpm_tis IFX0740:00: 2.0 TPM (device-id 0x1B, rev-id 16)
> > > [    3.725358] tpm tpm0: tpm_try_transmit: send(): error -5
> > > [    3.725359] tpm tpm0: [Firmware Bug]: TPM interrupt not working,
> > > polling instead
> > > 
> > > If the choice is "error message + polled-mode" vs "pinning a cpu with
> > > interrupts" I'd accept the former, but wanted Jarkko with his
> > > maintainer hat to weigh in.
> > > 
> > > Is there a simple sanity check I can run to see if the TPM is still
> > > operational in this state?
> > 
> > What about T490S?
> > 
> > /Jarkko
> > 
> 
> Hi Jarkko, I'm waiting to hear back from the t490s user, but I imagine
> it still has the problem as well.
> 
> Christian, were you able to try this patch and verify it still
> resolves the issue you were having with the kernel failing to get the
> timeouts and durations from the tpm?

Including those reverts would be a bogus change at this point.

The fix that I already applied obviously fixes an issue even if
it does not fix all the issues.

/Jarkko


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

* Re: [PATCH v2] tpm_tis: reserve chip for duration of tpm_tis_core_init
  2019-12-17 17:26               ` Jerry Snitselaar
@ 2019-12-18 23:09                 ` Jarkko Sakkinen
  0 siblings, 0 replies; 26+ messages in thread
From: Jarkko Sakkinen @ 2019-12-18 23:09 UTC (permalink / raw)
  To: Jerry Snitselaar, Dan Williams, Linux Kernel Mailing List,
	Christian Bundy, Peter Huewe, Jason Gunthorpe, Stefan Berger,
	stable, linux-integrity

On Tue, 2019-12-17 at 10:26 -0700, Jerry Snitselaar wrote:
> It appears he is out of the office until January, so I doubt I will hear
> anything back until then.

Unless we have access to a platform to sanely validate a fix
before that, we will have to wait until January then.

/Jarkko


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

* Re: [PATCH v2] tpm_tis: reserve chip for duration of tpm_tis_core_init
  2019-12-17 20:29             ` Jerry Snitselaar
@ 2019-12-18 23:12               ` Jarkko Sakkinen
  0 siblings, 0 replies; 26+ messages in thread
From: Jarkko Sakkinen @ 2019-12-18 23:12 UTC (permalink / raw)
  To: Jerry Snitselaar
  Cc: Dan Williams, Linux Kernel Mailing List, Christian Bundy,
	Peter Huewe, Jason Gunthorpe, Stefan Berger, stable,
	linux-integrity

On Tue, 2019-12-17 at 13:29 -0700, Jerry Snitselaar wrote:
> I just heard back from the t490s user, and as expected the problem still exists
> there with this patch.

OK. Now we have to reason what still is behaving incorrectly
and create a proper fix. Is he available to test a subsequent
fix?

Since the holidays are coming it might anyway take early Jan
before we can test anything but we can still try to find the
root cause by inspection.

/Jarkko


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

* Re: [PATCH v2] tpm_tis: reserve chip for duration of tpm_tis_core_init
  2019-12-18 23:06               ` Jarkko Sakkinen
@ 2019-12-18 23:31                 ` Dan Williams
  2019-12-19 10:07                   ` Jerry Snitselaar
  0 siblings, 1 reply; 26+ messages in thread
From: Dan Williams @ 2019-12-18 23:31 UTC (permalink / raw)
  To: Jarkko Sakkinen
  Cc: Jerry Snitselaar, Linux Kernel Mailing List, Christian Bundy,
	Peter Huewe, Jason Gunthorpe, Stefan Berger, stable,
	linux-integrity

On Wed, Dec 18, 2019 at 3:07 PM Jarkko Sakkinen
<jarkko.sakkinen@linux.intel.com> wrote:
>
> On Tue, 2019-12-17 at 10:18 -0700, Jerry Snitselaar wrote:
> > On Tue Dec 17 19, Jarkko Sakkinen wrote:
> > > On Mon, 2019-12-16 at 18:14 -0800, Dan Williams wrote:
> > > > On Mon, Dec 16, 2019 at 6:00 PM Jerry Snitselaar <jsnitsel@redhat.com> wrote:
> > > > > On Mon Dec 16 19, Dan Williams wrote:
> > > > > > On Mon, Dec 16, 2019 at 4:59 PM Jarkko Sakkinen
> > > > > > <jarkko.sakkinen@linux.intel.com> wrote:
> > > > > > > On Wed, 2019-12-11 at 16:54 -0700, Jerry Snitselaar wrote:
> > > > > > > > Instead of repeatedly calling tpm_chip_start/tpm_chip_stop when
> > > > > > > > issuing commands to the tpm during initialization, just reserve the
> > > > > > > > chip after wait_startup, and release it when we are ready to call
> > > > > > > > tpm_chip_register.
> > > > > > > >
> > > > > > > > Cc: Christian Bundy <christianbundy@fraction.io>
> > > > > > > > Cc: Dan Williams <dan.j.williams@intel.com>
> > > > > > > > Cc: Peter Huewe <peterhuewe@gmx.de>
> > > > > > > > Cc: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
> > > > > > > > Cc: Jason Gunthorpe <jgg@ziepe.ca>
> > > > > > > > Cc: Stefan Berger <stefanb@linux.vnet.ibm.com>
> > > > > > > > Cc: stable@vger.kernel.org
> > > > > > > > Cc: linux-integrity@vger.kernel.org
> > > > > > > > Fixes: a3fbfae82b4c ("tpm: take TPM chip power gating out of tpm_transmit()")
> > > > > > > > Fixes: 5b359c7c4372 ("tpm_tis_core: Turn on the TPM before probing IRQ's")
> > > > > > > > Signed-off-by: Jerry Snitselaar <jsnitsel@redhat.com>
> > > > > > >
> > > > > > > I pushed to my master with minor tweaks and added my tags.
> > > > > > >
> > > > > > > Please check before I put it to linux-next.
> > > > > >
> > > > > > I don't see it yet here:
> > > > > >
> > > > > > http://git.infradead.org/users/jjs/linux-tpmdd.git/shortlog/refs/heads/master
> > > > > >
> > > > > > However, I wanted to make sure you captured that this does *not* fix
> > > > > > the interrupt issue. I.e. make sure you remove the "Fixes:
> > > > > > 5b359c7c4372 ("tpm_tis_core: Turn on the TPM before probing IRQ's")"
> > > > > > tag.
> > > > > >
> > > > > > With that said, are you going to include the revert of:
> > > > > >
> > > > > > 1ea32c83c699 tpm_tis_core: Set TPM_CHIP_FLAG_IRQ before probing for interrupts
> > > > >
> > > > > Dan, with the above reverted do you still get the screaming interrupt?
> > > >
> > > > Yes, the screaming interrupt goes away, although it is replaced by
> > > > these messages when the driver starts:
> > > >
> > > > [    3.725131] tpm_tis IFX0740:00: 2.0 TPM (device-id 0x1B, rev-id 16)
> > > > [    3.725358] tpm tpm0: tpm_try_transmit: send(): error -5
> > > > [    3.725359] tpm tpm0: [Firmware Bug]: TPM interrupt not working,
> > > > polling instead
> > > >
> > > > If the choice is "error message + polled-mode" vs "pinning a cpu with
> > > > interrupts" I'd accept the former, but wanted Jarkko with his
> > > > maintainer hat to weigh in.
> > > >
> > > > Is there a simple sanity check I can run to see if the TPM is still
> > > > operational in this state?
> > >
> > > What about T490S?
> > >
> > > /Jarkko
> > >
> >
> > Hi Jarkko, I'm waiting to hear back from the t490s user, but I imagine
> > it still has the problem as well.
> >
> > Christian, were you able to try this patch and verify it still
> > resolves the issue you were having with the kernel failing to get the
> > timeouts and durations from the tpm?
>
> Including those reverts would be a bogus change at this point.

I'm failing to see how you arrived at that conclusion.

> The fix that I already applied obviously fixes an issue even if
> it does not fix all the issues.

These patches take a usable system and make it unusable:

1ea32c83c699 tpm_tis_core: Set TPM_CHIP_FLAG_IRQ before probing for interrupts
5b359c7c4372 tpm_tis_core: Turn on the TPM before probing IRQ's

...they need to be reverted, or the regression needs to be fixed, but
asserting that you fixed something else unrelated does not help.

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

* Re: [PATCH v2] tpm_tis: reserve chip for duration of tpm_tis_core_init
  2019-12-18 23:31                 ` Dan Williams
@ 2019-12-19 10:07                   ` Jerry Snitselaar
  2019-12-27  5:09                     ` Jarkko Sakkinen
  0 siblings, 1 reply; 26+ messages in thread
From: Jerry Snitselaar @ 2019-12-19 10:07 UTC (permalink / raw)
  To: Dan Williams
  Cc: Jarkko Sakkinen, Linux Kernel Mailing List, Christian Bundy,
	Peter Huewe, Jason Gunthorpe, Stefan Berger, stable,
	linux-integrity

On Wed Dec 18 19, Dan Williams wrote:
>On Wed, Dec 18, 2019 at 3:07 PM Jarkko Sakkinen
><jarkko.sakkinen@linux.intel.com> wrote:
>>
>> On Tue, 2019-12-17 at 10:18 -0700, Jerry Snitselaar wrote:
>> > On Tue Dec 17 19, Jarkko Sakkinen wrote:
>> > > On Mon, 2019-12-16 at 18:14 -0800, Dan Williams wrote:
>> > > > On Mon, Dec 16, 2019 at 6:00 PM Jerry Snitselaar <jsnitsel@redhat.com> wrote:
>> > > > > On Mon Dec 16 19, Dan Williams wrote:
>> > > > > > On Mon, Dec 16, 2019 at 4:59 PM Jarkko Sakkinen
>> > > > > > <jarkko.sakkinen@linux.intel.com> wrote:
>> > > > > > > On Wed, 2019-12-11 at 16:54 -0700, Jerry Snitselaar wrote:
>> > > > > > > > Instead of repeatedly calling tpm_chip_start/tpm_chip_stop when
>> > > > > > > > issuing commands to the tpm during initialization, just reserve the
>> > > > > > > > chip after wait_startup, and release it when we are ready to call
>> > > > > > > > tpm_chip_register.
>> > > > > > > >
>> > > > > > > > Cc: Christian Bundy <christianbundy@fraction.io>
>> > > > > > > > Cc: Dan Williams <dan.j.williams@intel.com>
>> > > > > > > > Cc: Peter Huewe <peterhuewe@gmx.de>
>> > > > > > > > Cc: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
>> > > > > > > > Cc: Jason Gunthorpe <jgg@ziepe.ca>
>> > > > > > > > Cc: Stefan Berger <stefanb@linux.vnet.ibm.com>
>> > > > > > > > Cc: stable@vger.kernel.org
>> > > > > > > > Cc: linux-integrity@vger.kernel.org
>> > > > > > > > Fixes: a3fbfae82b4c ("tpm: take TPM chip power gating out of tpm_transmit()")
>> > > > > > > > Fixes: 5b359c7c4372 ("tpm_tis_core: Turn on the TPM before probing IRQ's")
>> > > > > > > > Signed-off-by: Jerry Snitselaar <jsnitsel@redhat.com>
>> > > > > > >
>> > > > > > > I pushed to my master with minor tweaks and added my tags.
>> > > > > > >
>> > > > > > > Please check before I put it to linux-next.
>> > > > > >
>> > > > > > I don't see it yet here:
>> > > > > >
>> > > > > > http://git.infradead.org/users/jjs/linux-tpmdd.git/shortlog/refs/heads/master
>> > > > > >
>> > > > > > However, I wanted to make sure you captured that this does *not* fix
>> > > > > > the interrupt issue. I.e. make sure you remove the "Fixes:
>> > > > > > 5b359c7c4372 ("tpm_tis_core: Turn on the TPM before probing IRQ's")"
>> > > > > > tag.
>> > > > > >
>> > > > > > With that said, are you going to include the revert of:
>> > > > > >
>> > > > > > 1ea32c83c699 tpm_tis_core: Set TPM_CHIP_FLAG_IRQ before probing for interrupts
>> > > > >
>> > > > > Dan, with the above reverted do you still get the screaming interrupt?
>> > > >
>> > > > Yes, the screaming interrupt goes away, although it is replaced by
>> > > > these messages when the driver starts:
>> > > >
>> > > > [    3.725131] tpm_tis IFX0740:00: 2.0 TPM (device-id 0x1B, rev-id 16)
>> > > > [    3.725358] tpm tpm0: tpm_try_transmit: send(): error -5
>> > > > [    3.725359] tpm tpm0: [Firmware Bug]: TPM interrupt not working,
>> > > > polling instead
>> > > >
>> > > > If the choice is "error message + polled-mode" vs "pinning a cpu with
>> > > > interrupts" I'd accept the former, but wanted Jarkko with his
>> > > > maintainer hat to weigh in.
>> > > >
>> > > > Is there a simple sanity check I can run to see if the TPM is still
>> > > > operational in this state?
>> > >
>> > > What about T490S?
>> > >
>> > > /Jarkko
>> > >
>> >
>> > Hi Jarkko, I'm waiting to hear back from the t490s user, but I imagine
>> > it still has the problem as well.
>> >
>> > Christian, were you able to try this patch and verify it still
>> > resolves the issue you were having with the kernel failing to get the
>> > timeouts and durations from the tpm?
>>
>> Including those reverts would be a bogus change at this point.
>
>I'm failing to see how you arrived at that conclusion.
>
>> The fix that I already applied obviously fixes an issue even if
>> it does not fix all the issues.
>
>These patches take a usable system and make it unusable:
>
>1ea32c83c699 tpm_tis_core: Set TPM_CHIP_FLAG_IRQ before probing for interrupts
>5b359c7c4372 tpm_tis_core: Turn on the TPM before probing IRQ's
>
>...they need to be reverted, or the regression needs to be fixed, but
>asserting that you fixed something else unrelated does not help.
>

Reverting 1ea32c83c699 ("tpm_tis_core: Set TPM_CHIP_FLAG_IRQ before
probing for interrupts") would at least allow people impacted by this
to boot their systems without disabling the tpm, or blacklisting the
module while we figure this out. From what I can tell the tpm_tis code
was operating in that state since 570a36097f30 ("tpm: drop 'irq' from
struct tpm_vendor_specific") until Stefan's patch.

Regards,
Jerry


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

* Re: [PATCH v2] tpm_tis: reserve chip for duration of tpm_tis_core_init
  2019-12-19 10:07                   ` Jerry Snitselaar
@ 2019-12-27  5:09                     ` Jarkko Sakkinen
  2019-12-27  5:42                       ` Jarkko Sakkinen
  0 siblings, 1 reply; 26+ messages in thread
From: Jarkko Sakkinen @ 2019-12-27  5:09 UTC (permalink / raw)
  To: Jerry Snitselaar, Dan Williams
  Cc: Linux Kernel Mailing List, Christian Bundy, Peter Huewe,
	Jason Gunthorpe, Stefan Berger, stable, linux-integrity

On Thu, 2019-12-19 at 03:07 -0700, Jerry Snitselaar wrote:
> > These patches take a usable system and make it unusable:
> > 
> > 1ea32c83c699 tpm_tis_core: Set TPM_CHIP_FLAG_IRQ before probing for interrupts
> > 5b359c7c4372 tpm_tis_core: Turn on the TPM before probing IRQ's
> > 
> > ...they need to be reverted, or the regression needs to be fixed, but
> > asserting that you fixed something else unrelated does not help.
> > 
> 
> Reverting 1ea32c83c699 ("tpm_tis_core: Set TPM_CHIP_FLAG_IRQ before
> probing for interrupts") would at least allow people impacted by this
> to boot their systems without disabling the tpm, or blacklisting the
> module while we figure this out. From what I can tell the tpm_tis code
> was operating in that state since 570a36097f30 ("tpm: drop 'irq' from
> struct tpm_vendor_specific") until Stefan's patch.

I'll formalize a fix based on the reverts.

Sorry for the holiday latency.

/Jarkko


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

* Re: [PATCH v2] tpm_tis: reserve chip for duration of tpm_tis_core_init
  2019-12-27  5:09                     ` Jarkko Sakkinen
@ 2019-12-27  5:42                       ` Jarkko Sakkinen
  2019-12-27  6:03                         ` Jarkko Sakkinen
  0 siblings, 1 reply; 26+ messages in thread
From: Jarkko Sakkinen @ 2019-12-27  5:42 UTC (permalink / raw)
  To: Jerry Snitselaar, Dan Williams
  Cc: Linux Kernel Mailing List, Christian Bundy, Peter Huewe,
	Jason Gunthorpe, Stefan Berger, stable, linux-integrity

On Fri, 2019-12-27 at 07:09 +0200, Jarkko Sakkinen wrote:
> On Thu, 2019-12-19 at 03:07 -0700, Jerry Snitselaar wrote:
> > > These patches take a usable system and make it unusable:
> > > 
> > > 1ea32c83c699 tpm_tis_core: Set TPM_CHIP_FLAG_IRQ before probing for interrupts
> > > 5b359c7c4372 tpm_tis_core: Turn on the TPM before probing IRQ's
> > > 
> > > ...they need to be reverted, or the regression needs to be fixed, but
> > > asserting that you fixed something else unrelated does not help.
> > > 
> > 
> > Reverting 1ea32c83c699 ("tpm_tis_core: Set TPM_CHIP_FLAG_IRQ before
> > probing for interrupts") would at least allow people impacted by this
> > to boot their systems without disabling the tpm, or blacklisting the
> > module while we figure this out. From what I can tell the tpm_tis code
> > was operating in that state since 570a36097f30 ("tpm: drop 'irq' from
> > struct tpm_vendor_specific") until Stefan's patch.
> 
> I'll formalize a fix based on the reverts.
> 
> Sorry for the holiday latency.

OK, have a branch now for the PR:

for-linus-v5.5-rc4

Note: now contains the first revert but I'll add another patch if required.

/Jarkko


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

* Re: [PATCH v2] tpm_tis: reserve chip for duration of tpm_tis_core_init
  2019-12-27  5:42                       ` Jarkko Sakkinen
@ 2019-12-27  6:03                         ` Jarkko Sakkinen
  0 siblings, 0 replies; 26+ messages in thread
From: Jarkko Sakkinen @ 2019-12-27  6:03 UTC (permalink / raw)
  To: Jerry Snitselaar, Dan Williams
  Cc: Linux Kernel Mailing List, Christian Bundy, Peter Huewe,
	Jason Gunthorpe, Stefan Berger, stable, linux-integrity

On Fri, 2019-12-27 at 07:42 +0200, Jarkko Sakkinen wrote:
> On Fri, 2019-12-27 at 07:09 +0200, Jarkko Sakkinen wrote:
> > On Thu, 2019-12-19 at 03:07 -0700, Jerry Snitselaar wrote:
> > > > These patches take a usable system and make it unusable:
> > > > 
> > > > 1ea32c83c699 tpm_tis_core: Set TPM_CHIP_FLAG_IRQ before probing for interrupts
> > > > 5b359c7c4372 tpm_tis_core: Turn on the TPM before probing IRQ's
> > > > 
> > > > ...they need to be reverted, or the regression needs to be fixed, but
> > > > asserting that you fixed something else unrelated does not help.
> > > > 
> > > 
> > > Reverting 1ea32c83c699 ("tpm_tis_core: Set TPM_CHIP_FLAG_IRQ before
> > > probing for interrupts") would at least allow people impacted by this
> > > to boot their systems without disabling the tpm, or blacklisting the
> > > module while we figure this out. From what I can tell the tpm_tis code
> > > was operating in that state since 570a36097f30 ("tpm: drop 'irq' from
> > > struct tpm_vendor_specific") until Stefan's patch.
> > 
> > I'll formalize a fix based on the reverts.
> > 
> > Sorry for the holiday latency.
> 
> OK, have a branch now for the PR:
> 
> for-linus-v5.5-rc4
> 
> Note: now contains the first revert but I'll add another patch if required.

Jerry, can you check this and send me revert to your earlier fix *if*
required but first test with just this fix applied.

Thanks.

/Jarkko


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

end of thread, other threads:[~2019-12-27  6:03 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-11 23:17 [PATCH] tpm_tis: reserve chip for duration of tpm_tis_core_init Jerry Snitselaar
2019-12-11 23:26 ` Jerry Snitselaar
2019-12-11 23:30   ` Dan Williams
2019-12-11 23:49     ` Jerry Snitselaar
2019-12-11 23:54 ` [PATCH v2] " Jerry Snitselaar
2019-12-12  2:15   ` Dan Williams
2019-12-12  2:18     ` Dan Williams
2019-12-17  1:25       ` Jarkko Sakkinen
2019-12-17  0:58   ` Jarkko Sakkinen
2019-12-17  1:18     ` Dan Williams
2019-12-17  2:00       ` Jerry Snitselaar
2019-12-17  2:14         ` Dan Williams
2019-12-17 12:05           ` Jarkko Sakkinen
2019-12-17 17:18             ` Jerry Snitselaar
2019-12-17 17:26               ` Jerry Snitselaar
2019-12-18 23:09                 ` Jarkko Sakkinen
2019-12-18 23:06               ` Jarkko Sakkinen
2019-12-18 23:31                 ` Dan Williams
2019-12-19 10:07                   ` Jerry Snitselaar
2019-12-27  5:09                     ` Jarkko Sakkinen
2019-12-27  5:42                       ` Jarkko Sakkinen
2019-12-27  6:03                         ` Jarkko Sakkinen
2019-12-17 20:29             ` Jerry Snitselaar
2019-12-18 23:12               ` Jarkko Sakkinen
2019-12-17  1:19     ` Jarkko Sakkinen
2019-12-17  0:43 ` [PATCH] " 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).