tpm_tis: reserve chip for duration of tpm_tis_core_init
Subsystems (3)
PATCH 1/1 tpm_tis: reserve chip for duration of tpm_tis_core_init
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.
--- drivers/char/tpm/tpm_tis_core.c | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-)
drivers/char/tpm/tpm_tis_core.c +7 -10
@@ -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);
Signature · 1 line
2.24.0
Quoted 5 lines · Jerry Snitselaar
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 calltpm_chip_register.
Quoted 8 lines
Cc Christian Bundy <[email protected]>Cc Dan Williams <[email protected]>Cc Peter Huewe <[email protected]>Cc Jarkko Sakkinen <[email protected]>Cc Jason Gunthorpe <[email protected]>Cc Stefan Berger <[email protected]>
Typo on the list address, do you want me to resend Jarkko?
Quoted 3 lines
Fixes a3fbfae82b4c ("tpm: take TPM chip power gating out of tpm_transmit()")Signed-off-by Jerry Snitselaar <[email protected]>---
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
Quoted 22 lines · Jerry Snitselaar
Quoted 5 lines · Jerry Snitselaar
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 calltpm_chip_register.Quoted 8 lines
Cc Christian Bundy <[email protected]>Cc Dan Williams <[email protected]>Cc Peter Huewe <[email protected]>Cc Jarkko Sakkinen <[email protected]>Cc Jason Gunthorpe <[email protected]>Cc Stefan Berger <[email protected]>Typo on the list address, do you want me to resend Jarkko?
Quoted 3 lines
Fixes a3fbfae82b4c ("tpm: take TPM chip power gating out of tpm_transmit()")Signed-off-by Jerry Snitselaar <[email protected]>---
Quoted 5 lines
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?
Quoted 23 lines · Dan Williams
Quoted 22 lines · Jerry Snitselaar
Quoted 5 lines · Jerry Snitselaar
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 calltpm_chip_register.Quoted 8 lines
Cc Christian Bundy <[email protected]>Cc Dan Williams <[email protected]>Cc Peter Huewe <[email protected]>Cc Jarkko Sakkinen <[email protected]>Cc Jason Gunthorpe <[email protected]>Cc Stefan Berger <[email protected]>Typo on the list address, do you want me to resend Jarkko?
Quoted 3 lines
Fixes a3fbfae82b4c ("tpm: take TPM chip power gating out of tpm_transmit()")Signed-off-by Jerry Snitselaar <[email protected]>---
Quoted 9 lines
Quoted 5 lines
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.
PATCH v2 1/1 tpm_tis: reserve chip for duration of tpm_tis_core_init
In reply to Jerry SnitselaarInstead 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.
---
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(-)
drivers/char/tpm/tpm_tis_core.c +7 -10
@@ -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);
Signature · 1 line
2.24.0
Quoted 6 lines · Jerry Snitselaar
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 calltpm_chip_register.
Quoted 10 lines
Cc Christian Bundy <[email protected]>Cc Dan Williams <[email protected]>Cc Peter Huewe <[email protected]>Cc Jarkko Sakkinen <[email protected]>Cc Jason Gunthorpe <[email protected]>Cc Stefan Berger <[email protected]>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.
Quoted 19 lines · Dan Williams
Quoted 6 lines · Jerry Snitselaar
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 calltpm_chip_register.Quoted 10 lines
Cc Christian Bundy <[email protected]>Cc Dan Williams <[email protected]>Cc Peter Huewe <[email protected]>Cc Jarkko Sakkinen <[email protected]>Cc Jason Gunthorpe <[email protected]>Cc Stefan Berger <[email protected]>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")
Quoted 2 lines
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?
Quoted 18 lines · Dan Williams
Quoted 17 lines · Dan Williams
Quoted 15 lines · Jerry Snitselaar
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 calltpm_chip_register.Cc Christian Bundy <[email protected]>Cc Dan Williams <[email protected]>Cc Peter Huewe <[email protected]>Cc Jarkko Sakkinen <[email protected]>Cc Jason Gunthorpe <[email protected]>Cc Stefan Berger <[email protected]>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")
Quoted 4 lines
Quoted 2 lines
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
Quoted 5 lines · Jerry Snitselaar
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 calltpm_chip_register.
Quoted 11 lines
Cc Christian Bundy <[email protected]>Cc Dan Williams <[email protected]>Cc Peter Huewe <[email protected]>Cc Jarkko Sakkinen <[email protected]>Cc Jason Gunthorpe <[email protected]>Cc Stefan Berger <[email protected]>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 <[email protected]>
I pushed to my master with minor tweaks and added my tags.
Please check before I put it to linux-next.
/Jarkko
Quoted 19 lines · Jarkko Sakkinen
Quoted 5 lines · Jerry Snitselaar
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 calltpm_chip_register.Quoted 11 lines
Cc Christian Bundy <[email protected]>Cc Dan Williams <[email protected]>Cc Peter Huewe <[email protected]>Cc Jarkko Sakkinen <[email protected]>Cc Jason Gunthorpe <[email protected]>Cc Stefan Berger <[email protected]>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 <[email protected]>
Quoted 3 lines
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?
Quoted 29 lines · Dan Williams
Quoted 19 lines · Jarkko Sakkinen
Quoted 5 lines · Jerry Snitselaar
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 calltpm_chip_register.Quoted 11 lines
Cc Christian Bundy <[email protected]>Cc Dan Williams <[email protected]>Cc Peter Huewe <[email protected]>Cc Jarkko Sakkinen <[email protected]>Cc Jason Gunthorpe <[email protected]>Cc Stefan Berger <[email protected]>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 <[email protected]>Quoted 3 lines
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
Quoted 8 lines
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:
1ea32c83c699tpm_tis_core: SetTPM_CHIP_FLAG_IRQbefore probing for interrupts
Dan, with the above reverted do you still get the screaming interrupt?
Quoted 4 lines
5b359c7c4372tpm_tis_core: Turn on the TPM before probing IRQ's...in your -rc3 pull?
Quoted 36 lines · Jerry Snitselaar
Quoted 34 lines · Dan Williams
Quoted 19 lines · Jarkko Sakkinen
Quoted 5 lines · Jerry Snitselaar
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 calltpm_chip_register.Quoted 11 lines
Cc Christian Bundy <[email protected]>Cc Dan Williams <[email protected]>Cc Peter Huewe <[email protected]>Cc Jarkko Sakkinen <[email protected]>Cc Jason Gunthorpe <[email protected]>Cc Stefan Berger <[email protected]>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 <[email protected]>Quoted 3 lines
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.
Quoted 5 lines
Quoted 3 lines
With that said, are you going to include the revert of:
1ea32c83c699tpm_tis_core: SetTPM_CHIP_FLAG_IRQbefore probing for interruptsDan, 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?
Quoted 47 lines · Dan Williams
Quoted 34 lines · Jerry Snitselaar
Quoted 33 lines · Dan Williams
Quoted 18 lines · Jarkko Sakkinen
Quoted 5 lines · Jerry Snitselaar
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 calltpm_chip_register.Quoted 11 lines
Cc Christian Bundy <[email protected]>Cc Dan Williams <[email protected]>Cc Peter Huewe <[email protected]>Cc Jarkko Sakkinen <[email protected]>Cc Jason Gunthorpe <[email protected]>Cc Stefan Berger <[email protected]>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 <[email protected]>Quoted 3 lines
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.Quoted 5 lines
Quoted 3 lines
With that said, are you going to include the revert of:
1ea32c83c699tpm_tis_core: SetTPM_CHIP_FLAG_IRQbefore probing for interruptsDan, 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,
Quoted 8 lines
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
Quoted 54 lines · Jarkko Sakkinen
Quoted 53 lines · Dan Williams
Quoted 34 lines · Jerry Snitselaar
Quoted 33 lines · Dan Williams
Quoted 18 lines · Jarkko Sakkinen
Quoted 5 lines · Jerry Snitselaar
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 calltpm_chip_register.Quoted 11 lines
Cc Christian Bundy <[email protected]>Cc Dan Williams <[email protected]>Cc Peter Huewe <[email protected]>Cc Jarkko Sakkinen <[email protected]>Cc Jason Gunthorpe <[email protected]>Cc Stefan Berger <[email protected]>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 <[email protected]>Quoted 3 lines
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.Quoted 5 lines
Quoted 3 lines
With that said, are you going to include the revert of:
1ea32c83c699tpm_tis_core: SetTPM_CHIP_FLAG_IRQbefore probing for interruptsDan, 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.
Quoted 7 lines
Quoted 2 lines
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
Quoted 58 lines · Jerry Snitselaar
Quoted 57 lines · Jarkko Sakkinen
Quoted 55 lines · Dan Williams
Quoted 34 lines · Jerry Snitselaar
Quoted 33 lines · Dan Williams
Quoted 18 lines · Jarkko Sakkinen
Quoted 5 lines · Jerry Snitselaar
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 calltpm_chip_register.Quoted 11 lines
Cc Christian Bundy <[email protected]>Cc Dan Williams <[email protected]>Cc Peter Huewe <[email protected]>Cc Jarkko Sakkinen <[email protected]>Cc Jason Gunthorpe <[email protected]>Cc Stefan Berger <[email protected]>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 <[email protected]>Quoted 3 lines
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.Quoted 5 lines
Quoted 3 lines
With that said, are you going to include the revert of:
1ea32c83c699tpm_tis_core: SetTPM_CHIP_FLAG_IRQbefore probing for interruptsDan, 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?
Quoted 8 lines
Quoted 4 lines
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.
Quoted 6 lines
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
Quoted 2 lines · Jerry Snitselaar
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
Quoted 63 lines · Jerry Snitselaar
Quoted 54 lines · Jarkko Sakkinen
Quoted 53 lines · Dan Williams
Quoted 34 lines · Jerry Snitselaar
Quoted 33 lines · Dan Williams
Quoted 18 lines · Jarkko Sakkinen
Quoted 5 lines · Jerry Snitselaar
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 calltpm_chip_register.Quoted 11 lines
Cc Christian Bundy <[email protected]>Cc Dan Williams <[email protected]>Cc Peter Huewe <[email protected]>Cc Jarkko Sakkinen <[email protected]>Cc Jason Gunthorpe <[email protected]>Cc Stefan Berger <[email protected]>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 <[email protected]>Quoted 3 lines
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.Quoted 5 lines
Quoted 3 lines
With that said, are you going to include the revert of:
1ea32c83c699tpm_tis_core: SetTPM_CHIP_FLAG_IRQbefore probing for interruptsDan, 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.
Quoted 7 lines
Quoted 2 lines
Is there a simple sanity check I can run to see if the TPM is still operational in this state?
What about T490S?
/Jarkko
Quoted 6 lines
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
Quoted 65 lines · Jarkko Sakkinen
Quoted 63 lines · Jerry Snitselaar
Quoted 61 lines · Jarkko Sakkinen
Quoted 47 lines · Dan Williams
Quoted 34 lines · Jerry Snitselaar
Quoted 33 lines · Dan Williams
Quoted 18 lines · Jarkko Sakkinen
Quoted 5 lines · Jerry Snitselaar
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 calltpm_chip_register.Quoted 11 lines
Cc Christian Bundy <[email protected]>Cc Dan Williams <[email protected]>Cc Peter Huewe <[email protected]>Cc Jarkko Sakkinen <[email protected]>Cc Jason Gunthorpe <[email protected]>Cc Stefan Berger <[email protected]>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 <[email protected]>Quoted 3 lines
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.Quoted 5 lines
Quoted 3 lines
With that said, are you going to include the revert of:
1ea32c83c699tpm_tis_core: SetTPM_CHIP_FLAG_IRQbefore probing for interruptsDan, 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,Quoted 8 lines
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
Quoted 8 lines
Quoted 6 lines
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.
Quoted 2 lines
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.
Quoted 81 lines · Dan Williams
Quoted 65 lines · Jarkko Sakkinen
Quoted 63 lines · Jerry Snitselaar
Quoted 61 lines · Jarkko Sakkinen
Quoted 47 lines · Dan Williams
Quoted 34 lines · Jerry Snitselaar
Quoted 33 lines · Dan Williams
Quoted 18 lines · Jarkko Sakkinen
Quoted 5 lines · Jerry Snitselaar
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 calltpm_chip_register.Quoted 11 lines
Cc Christian Bundy <[email protected]>Cc Dan Williams <[email protected]>Cc Peter Huewe <[email protected]>Cc Jarkko Sakkinen <[email protected]>Cc Jason Gunthorpe <[email protected]>Cc Stefan Berger <[email protected]>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 <[email protected]>Quoted 3 lines
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.Quoted 5 lines
Quoted 3 lines
With that said, are you going to include the revert of:
1ea32c83c699tpm_tis_core: SetTPM_CHIP_FLAG_IRQbefore probing for interruptsDan, 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,Quoted 8 lines
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
Quoted 8 lines
Quoted 6 lines
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.
Quoted 2 lines
The fix that I already applied obviously fixes an issue even if it does not fix all the issues.
Quoted 8 lines
These patches take a usable system and make it unusable:
1ea32c83c699tpm_tis_core: SetTPM_CHIP_FLAG_IRQbefore probing for interrupts5b359c7c4372tpm_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
Quoted 9 lines · Jerry Snitselaar
Quoted 8 lines
These patches take a usable system and make it unusable:
1ea32c83c699tpm_tis_core: SetTPM_CHIP_FLAG_IRQbefore probing for interrupts5b359c7c4372tpm_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.
Quoted 6 lines
Reverting
1ea32c83c699("tpm_tis_core: SetTPM_CHIP_FLAG_IRQbefore 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 thetpm_tiscode was operating in that state since570a36097f30("tpm: drop 'irq' from structtpm_vendor_specific") until Stefan's patch.
I'll formalize a fix based on the reverts.
Sorry for the holiday latency.
/Jarkko
Quoted 17 lines · Jarkko Sakkinen
Quoted 9 lines · Jerry Snitselaar
Quoted 8 lines
These patches take a usable system and make it unusable:
1ea32c83c699tpm_tis_core: SetTPM_CHIP_FLAG_IRQbefore probing for interrupts5b359c7c4372tpm_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.
Quoted 6 lines
Reverting
1ea32c83c699("tpm_tis_core: SetTPM_CHIP_FLAG_IRQbefore 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 thetpm_tiscode was operating in that state since570a36097f30("tpm: drop 'irq' from structtpm_vendor_specific") until Stefan's patch.
Quoted 3 lines
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
Quoted 20 lines · Jarkko Sakkinen
Quoted 19 lines · Jarkko Sakkinen
Quoted 9 lines · Jerry Snitselaar
Quoted 8 lines
These patches take a usable system and make it unusable:
1ea32c83c699tpm_tis_core: SetTPM_CHIP_FLAG_IRQbefore probing for interrupts5b359c7c4372tpm_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.
Quoted 6 lines
Reverting
1ea32c83c699("tpm_tis_core: SetTPM_CHIP_FLAG_IRQbefore 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 thetpm_tiscode was operating in that state since570a36097f30("tpm: drop 'irq' from structtpm_vendor_specific") until Stefan's patch.I'll formalize a fix based on the reverts.
Quoted 7 lines
Quoted 1 line
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
Quoted 54 lines · Jarkko Sakkinen
Quoted 53 lines · Dan Williams
Quoted 34 lines · Jerry Snitselaar
Quoted 33 lines · Dan Williams
Quoted 18 lines · Jarkko Sakkinen
Quoted 5 lines · Jerry Snitselaar
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 calltpm_chip_register.Quoted 11 lines
Cc Christian Bundy <[email protected]>Cc Dan Williams <[email protected]>Cc Peter Huewe <[email protected]>Cc Jarkko Sakkinen <[email protected]>Cc Jason Gunthorpe <[email protected]>Cc Stefan Berger <[email protected]>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 <[email protected]>Quoted 3 lines
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.Quoted 5 lines
Quoted 3 lines
With that said, are you going to include the revert of:
1ea32c83c699tpm_tis_core: SetTPM_CHIP_FLAG_IRQbefore probing for interruptsDan, 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.
Quoted 7 lines
Quoted 2 lines
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
Quoted 2 lines · Jerry Snitselaar
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
Quoted 18 lines · Jarkko Sakkinen
Quoted 5 lines · Jerry Snitselaar
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 calltpm_chip_register.Quoted 11 lines
Cc Christian Bundy <[email protected]>Cc Dan Williams <[email protected]>Cc Peter Huewe <[email protected]>Cc Jarkko Sakkinen <[email protected]>Cc Jason Gunthorpe <[email protected]>Cc Stefan Berger <[email protected]>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 <[email protected]>
Quoted 3 lines
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
Quoted 5 lines · Jerry Snitselaar
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 calltpm_chip_register.
Quoted 10 lines
Cc Christian Bundy <[email protected]>Cc Dan Williams <[email protected]>Cc Peter Huewe <[email protected]>Cc Jarkko Sakkinen <[email protected]>Cc Jason Gunthorpe <[email protected]>Cc Stefan Berger <[email protected]>Fixes a3fbfae82b4c ("tpm: take TPM chip power gating out of tpm_transmit()")Signed-off-by Jerry Snitselaar <[email protected]>
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