stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] Revert patches fixing probing of interrupts
@ 2019-11-26 13:17 Stefan Berger
  2019-11-26 13:17 ` [PATCH 1/2] tpm: Revert "tpm_tis_core: Set TPM_CHIP_FLAG_IRQ before probing for interrupts" Stefan Berger
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Stefan Berger @ 2019-11-26 13:17 UTC (permalink / raw)
  To: linux-integrity, jarkko.sakkinen
  Cc: linux-kernel, stable, linux-security-module, Stefan Berger

From: Stefan Berger <stefanb@linux.ibm.com>

Revert the patches that were fixing the probing of interrupts due
to reports of interrupt stroms on some systems

The following Linux kernel versions are affected:

- 5.4
- 5.3.4 and later
- 5.2.19 and later

Stefan Berger (2):
  tpm: Revert "tpm_tis_core: Set TPM_CHIP_FLAG_IRQ before probing for
    interrupts"
  tpm: Revert "tpm_tis_core: Turn on the TPM before probing IRQ's"

 drivers/char/tpm/tpm_tis_core.c | 3 ---
 1 file changed, 3 deletions(-)

-- 
2.14.5


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

* [PATCH 1/2] tpm: Revert "tpm_tis_core: Set TPM_CHIP_FLAG_IRQ before probing for interrupts"
  2019-11-26 13:17 [PATCH 0/2] Revert patches fixing probing of interrupts Stefan Berger
@ 2019-11-26 13:17 ` Stefan Berger
  2019-11-26 13:17 ` [PATCH 2/2] tpm: Revert "tpm_tis_core: Turn on the TPM before probing IRQ's" Stefan Berger
  2019-11-29 22:37 ` [PATCH 0/2] Revert patches fixing probing of interrupts Jarkko Sakkinen
  2 siblings, 0 replies; 9+ messages in thread
From: Stefan Berger @ 2019-11-26 13:17 UTC (permalink / raw)
  To: linux-integrity, jarkko.sakkinen
  Cc: linux-kernel, stable, linux-security-module, Stefan Berger,
	Jerry Snitselaar

From: Stefan Berger <stefanb@linux.ibm.com>

Revert the patch that was setting the TPM_CHIP_FLAG_IRQ before probing for
interrupts.

Fixes: 1ea32c83c699 ("tpm_tis_core: Set TPM_CHIP_FLAG_IRQ before probing for interrupts")
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
Reported-by: Jerry Snitselaar <jsnitsel@redhat.com>
Cc: stable@vger.kernel.org
---
 drivers/char/tpm/tpm_tis_core.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/char/tpm/tpm_tis_core.c b/drivers/char/tpm/tpm_tis_core.c
index 8af2cee1a762..5dc52c4e2292 100644
--- a/drivers/char/tpm/tpm_tis_core.c
+++ b/drivers/char/tpm/tpm_tis_core.c
@@ -1060,7 +1060,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


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

* [PATCH 2/2] tpm: Revert "tpm_tis_core: Turn on the TPM before probing IRQ's"
  2019-11-26 13:17 [PATCH 0/2] Revert patches fixing probing of interrupts Stefan Berger
  2019-11-26 13:17 ` [PATCH 1/2] tpm: Revert "tpm_tis_core: Set TPM_CHIP_FLAG_IRQ before probing for interrupts" Stefan Berger
@ 2019-11-26 13:17 ` Stefan Berger
  2019-11-29 22:37 ` [PATCH 0/2] Revert patches fixing probing of interrupts Jarkko Sakkinen
  2 siblings, 0 replies; 9+ messages in thread
From: Stefan Berger @ 2019-11-26 13:17 UTC (permalink / raw)
  To: linux-integrity, jarkko.sakkinen
  Cc: linux-kernel, stable, linux-security-module, Stefan Berger,
	Jerry Snitselaar

From: Stefan Berger <stefanb@linux.ibm.com>

Revert the patch that was turning the TPM on before probing for IRQs.

Fixes: 5b359c7c4372 ("tpm_tis_core: Turn on the TPM before probing IRQ's")
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
Reported-by: Jerry Snitselaar <jsnitsel@redhat.com>
Cc: stable@vger.kernel.org
---
 drivers/char/tpm/tpm_tis_core.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/char/tpm/tpm_tis_core.c b/drivers/char/tpm/tpm_tis_core.c
index 5dc52c4e2292..27c6ca031e23 100644
--- a/drivers/char/tpm/tpm_tis_core.c
+++ b/drivers/char/tpm/tpm_tis_core.c
@@ -1059,7 +1059,6 @@ int tpm_tis_core_init(struct device *dev, struct tpm_tis_data *priv, int irq,
 			goto out_err;
 		}
 
-		tpm_chip_start(chip);
 		if (irq) {
 			tpm_tis_probe_irq_single(chip, intmask, IRQF_SHARED,
 						 irq);
@@ -1069,7 +1068,6 @@ 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);
 	}
 
 	rc = tpm_chip_register(chip);
-- 
2.14.5


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

* Re: [PATCH 0/2] Revert patches fixing probing of interrupts
  2019-11-26 13:17 [PATCH 0/2] Revert patches fixing probing of interrupts Stefan Berger
  2019-11-26 13:17 ` [PATCH 1/2] tpm: Revert "tpm_tis_core: Set TPM_CHIP_FLAG_IRQ before probing for interrupts" Stefan Berger
  2019-11-26 13:17 ` [PATCH 2/2] tpm: Revert "tpm_tis_core: Turn on the TPM before probing IRQ's" Stefan Berger
@ 2019-11-29 22:37 ` Jarkko Sakkinen
  2019-12-01 23:54   ` Stefan Berger
  2 siblings, 1 reply; 9+ messages in thread
From: Jarkko Sakkinen @ 2019-11-29 22:37 UTC (permalink / raw)
  To: Stefan Berger
  Cc: linux-integrity, linux-kernel, stable, linux-security-module,
	Stefan Berger

On Tue, Nov 26, 2019 at 08:17:51AM -0500, Stefan Berger wrote:
> From: Stefan Berger <stefanb@linux.ibm.com>
> 
> Revert the patches that were fixing the probing of interrupts due
> to reports of interrupt stroms on some systems

Can you explain how reverting is going to fix the issue?

This is wrong way to move forward. The root cause must be identified
first and then decide actions like always in any situation.

/Jarkko

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

* Re: [PATCH 0/2] Revert patches fixing probing of interrupts
  2019-11-29 22:37 ` [PATCH 0/2] Revert patches fixing probing of interrupts Jarkko Sakkinen
@ 2019-12-01 23:54   ` Stefan Berger
  2019-12-02 18:55     ` Jerry Snitselaar
  0 siblings, 1 reply; 9+ messages in thread
From: Stefan Berger @ 2019-12-01 23:54 UTC (permalink / raw)
  To: Jarkko Sakkinen, Stefan Berger
  Cc: linux-integrity, linux-kernel, stable, linux-security-module

On 11/29/19 5:37 PM, Jarkko Sakkinen wrote:
> On Tue, Nov 26, 2019 at 08:17:51AM -0500, Stefan Berger wrote:
>> From: Stefan Berger <stefanb@linux.ibm.com>
>>
>> Revert the patches that were fixing the probing of interrupts due
>> to reports of interrupt stroms on some systems
> Can you explain how reverting is going to fix the issue?


The reverts fix 'the interrupt storm issue' that they are causing on 
some systems but don't fix the issue with the interrupt mode not being 
used. I was hoping Jerry would get access to a system faster but this 
didn't seem to be the case. So sending these patches seemed the better 
solution than leaving 5.4.x with the problem but going back to when it 
worked 'better.'


>
> This is wrong way to move forward. The root cause must be identified
> first and then decide actions like always in any situation.
>
> /Jarkko



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

* Re: [PATCH 0/2] Revert patches fixing probing of interrupts
  2019-12-01 23:54   ` Stefan Berger
@ 2019-12-02 18:55     ` Jerry Snitselaar
  2019-12-09 19:42       ` Jarkko Sakkinen
  0 siblings, 1 reply; 9+ messages in thread
From: Jerry Snitselaar @ 2019-12-02 18:55 UTC (permalink / raw)
  To: Stefan Berger
  Cc: Jarkko Sakkinen, Stefan Berger, linux-integrity, linux-kernel,
	stable, linux-security-module

On Sun Dec 01 19, Stefan Berger wrote:
>On 11/29/19 5:37 PM, Jarkko Sakkinen wrote:
>>On Tue, Nov 26, 2019 at 08:17:51AM -0500, Stefan Berger wrote:
>>>From: Stefan Berger <stefanb@linux.ibm.com>
>>>
>>>Revert the patches that were fixing the probing of interrupts due
>>>to reports of interrupt stroms on some systems
>>Can you explain how reverting is going to fix the issue?
>
>
>The reverts fix 'the interrupt storm issue' that they are causing on 
>some systems but don't fix the issue with the interrupt mode not being 
>used. I was hoping Jerry would get access to a system faster but this 
>didn't seem to be the case. So sending these patches seemed the better 
>solution than leaving 5.4.x with the problem but going back to when it 
>worked 'better.'
>

I finally heard back from IT support, and unfortunately they don't
have any T490s systems to give out on temp loan. So I can only send
patched kernels to the end user that had the problem.

>
>>
>>This is wrong way to move forward. The root cause must be identified
>>first and then decide actions like always in any situation.
>>
>>/Jarkko
>
>


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

* Re: [PATCH 0/2] Revert patches fixing probing of interrupts
  2019-12-02 18:55     ` Jerry Snitselaar
@ 2019-12-09 19:42       ` Jarkko Sakkinen
  2019-12-09 21:55         ` Jerry Snitselaar
  0 siblings, 1 reply; 9+ messages in thread
From: Jarkko Sakkinen @ 2019-12-09 19:42 UTC (permalink / raw)
  To: Stefan Berger, Stefan Berger, linux-integrity, linux-kernel,
	stable, linux-security-module

On Mon, Dec 02, 2019 at 11:55:20AM -0700, Jerry Snitselaar wrote:
> On Sun Dec 01 19, Stefan Berger wrote:
> > On 11/29/19 5:37 PM, Jarkko Sakkinen wrote:
> > > On Tue, Nov 26, 2019 at 08:17:51AM -0500, Stefan Berger wrote:
> > > > From: Stefan Berger <stefanb@linux.ibm.com>
> > > > 
> > > > Revert the patches that were fixing the probing of interrupts due
> > > > to reports of interrupt stroms on some systems
> > > Can you explain how reverting is going to fix the issue?
> > 
> > 
> > The reverts fix 'the interrupt storm issue' that they are causing on
> > some systems but don't fix the issue with the interrupt mode not being
> > used. I was hoping Jerry would get access to a system faster but this
> > didn't seem to be the case. So sending these patches seemed the better
> > solution than leaving 5.4.x with the problem but going back to when it
> > worked 'better.'
> > 
> 
> I finally heard back from IT support, and unfortunately they don't
> have any T490s systems to give out on temp loan. So I can only send
> patched kernels to the end user that had the problem.

At least it is a fact that tpm_chip_stop() is called too early and that
is destined to cause issues.

Should I bake a patch or do you have already something?

/Jarkko

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

* Re: [PATCH 0/2] Revert patches fixing probing of interrupts
  2019-12-09 19:42       ` Jarkko Sakkinen
@ 2019-12-09 21:55         ` Jerry Snitselaar
  2019-12-11 11:22           ` Jarkko Sakkinen
  0 siblings, 1 reply; 9+ messages in thread
From: Jerry Snitselaar @ 2019-12-09 21:55 UTC (permalink / raw)
  To: Jarkko Sakkinen
  Cc: Stefan Berger, Stefan Berger, linux-integrity, linux-kernel,
	stable, linux-security-module

On Mon Dec 09 19, Jarkko Sakkinen wrote:
>On Mon, Dec 02, 2019 at 11:55:20AM -0700, Jerry Snitselaar wrote:
>> On Sun Dec 01 19, Stefan Berger wrote:
>> > On 11/29/19 5:37 PM, Jarkko Sakkinen wrote:
>> > > On Tue, Nov 26, 2019 at 08:17:51AM -0500, Stefan Berger wrote:
>> > > > From: Stefan Berger <stefanb@linux.ibm.com>
>> > > >
>> > > > Revert the patches that were fixing the probing of interrupts due
>> > > > to reports of interrupt stroms on some systems
>> > > Can you explain how reverting is going to fix the issue?
>> >
>> >
>> > The reverts fix 'the interrupt storm issue' that they are causing on
>> > some systems but don't fix the issue with the interrupt mode not being
>> > used. I was hoping Jerry would get access to a system faster but this
>> > didn't seem to be the case. So sending these patches seemed the better
>> > solution than leaving 5.4.x with the problem but going back to when it
>> > worked 'better.'
>> >
>>
>> I finally heard back from IT support, and unfortunately they don't
>> have any T490s systems to give out on temp loan. So I can only send
>> patched kernels to the end user that had the problem.
>
>At least it is a fact that tpm_chip_stop() is called too early and that
>is destined to cause issues.
>
>Should I bake a patch or do you have already something?
>
>/Jarkko
>

This is what I'm currently building:

diff --git a/drivers/char/tpm/tpm_tis_core.c b/drivers/char/tpm/tpm_tis_core.c
index 270f43acbb77..17184c07eb51 100644
--- a/drivers/char/tpm/tpm_tis_core.c
+++ b/drivers/char/tpm/tpm_tis_core.c
@@ -899,13 +899,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;
@@ -914,9 +914,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;
  
@@ -980,7 +979,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,
@@ -991,18 +989,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);


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

* Re: [PATCH 0/2] Revert patches fixing probing of interrupts
  2019-12-09 21:55         ` Jerry Snitselaar
@ 2019-12-11 11:22           ` Jarkko Sakkinen
  0 siblings, 0 replies; 9+ messages in thread
From: Jarkko Sakkinen @ 2019-12-11 11:22 UTC (permalink / raw)
  To: Stefan Berger, Stefan Berger, linux-integrity, linux-kernel,
	stable, linux-security-module

On Mon, Dec 09, 2019 at 02:55:35PM -0700, Jerry Snitselaar wrote:
> On Mon Dec 09 19, Jarkko Sakkinen wrote:
> > On Mon, Dec 02, 2019 at 11:55:20AM -0700, Jerry Snitselaar wrote:
> > > On Sun Dec 01 19, Stefan Berger wrote:
> > > > On 11/29/19 5:37 PM, Jarkko Sakkinen wrote:
> > > > > On Tue, Nov 26, 2019 at 08:17:51AM -0500, Stefan Berger wrote:
> > > > > > From: Stefan Berger <stefanb@linux.ibm.com>
> > > > > >
> > > > > > Revert the patches that were fixing the probing of interrupts due
> > > > > > to reports of interrupt stroms on some systems
> > > > > Can you explain how reverting is going to fix the issue?
> > > >
> > > >
> > > > The reverts fix 'the interrupt storm issue' that they are causing on
> > > > some systems but don't fix the issue with the interrupt mode not being
> > > > used. I was hoping Jerry would get access to a system faster but this
> > > > didn't seem to be the case. So sending these patches seemed the better
> > > > solution than leaving 5.4.x with the problem but going back to when it
> > > > worked 'better.'
> > > >
> > > 
> > > I finally heard back from IT support, and unfortunately they don't
> > > have any T490s systems to give out on temp loan. So I can only send
> > > patched kernels to the end user that had the problem.
> > 
> > At least it is a fact that tpm_chip_stop() is called too early and that
> > is destined to cause issues.
> > 
> > Should I bake a patch or do you have already something?
> > 
> > /Jarkko
> > 
> 
> This is what I'm currently building:

With a quick skim looks what I had in mind.

/Jarkko

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

end of thread, other threads:[~2019-12-11 11:23 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-26 13:17 [PATCH 0/2] Revert patches fixing probing of interrupts Stefan Berger
2019-11-26 13:17 ` [PATCH 1/2] tpm: Revert "tpm_tis_core: Set TPM_CHIP_FLAG_IRQ before probing for interrupts" Stefan Berger
2019-11-26 13:17 ` [PATCH 2/2] tpm: Revert "tpm_tis_core: Turn on the TPM before probing IRQ's" Stefan Berger
2019-11-29 22:37 ` [PATCH 0/2] Revert patches fixing probing of interrupts Jarkko Sakkinen
2019-12-01 23:54   ` Stefan Berger
2019-12-02 18:55     ` Jerry Snitselaar
2019-12-09 19:42       ` Jarkko Sakkinen
2019-12-09 21:55         ` Jerry Snitselaar
2019-12-11 11:22           ` 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).