From: Breno Leitao <leitao@debian.org>
To: Jarkko Sakkinen <jarkko@kernel.org>
Cc: Peter Huewe <peterhuewe@gmx.de>, Jason Gunthorpe <jgg@ziepe.ca>,
Jonathan Corbet <corbet@lwn.net>,
Shuah Khan <skhan@linuxfoundation.org>,
Randy Dunlap <rdunlap@infradead.org>,
linux-integrity@vger.kernel.org, linux-kernel@vger.kernel.org,
surenkj@amazon.com, noodles@meta.com, linux-doc@vger.kernel.org,
kernel-team@meta.com
Subject: Re: [PATCH v3 1/2] tpm: Disable a TPM that stops responding
Date: Fri, 13 Nov 2026 07:14:39 -0800 [thread overview]
Message-ID: <avconeIiDzMIq40n@gmail.com> (raw)
In-Reply-To: <avchzL3uEXHbvNv_@kernel.org>
On Fri, Nov 13, 2026 at 04:42:20PM +0200, Jarkko Sakkinen wrote:
> On Fri, Nov 13, 2026 at 02:38:58AM -0800, Breno Leitao wrote:
> > @@ -40,6 +40,11 @@ module_param_named(suspend_pcr, tpm_suspend_pcr, uint, 0644);
> > MODULE_PARM_DESC(suspend_pcr,
> > "PCR to use for dummy writes to facilitate flush on suspend.");
> >
> > +static unsigned int tpm_max_missed_responses = 60;
>
> This looks good but I started to think this number. I guess it is high
> because there's never reset-to-zero for chip->nr_missed_responses.
>
> I think three or four trials at most should be enough, and when there
> is a successful transmission chip->nr_missed_responses should reset.
It does reset. Any command that gets an answer, whatever its return
code, sets the count back to zero:
if (ret >= 0) {
chip->nr_missed_responses = 0;
so the TPM is only disabled after 60 timeouts with no answer in between.
> One thing that bothers me in the commit message is a piece of
> information that is missing: when does it start to return error?
> From the get go?
>
> I mean based on provided information one could presume that this
> could be also fixed at driver init by doing a few smoke tests
> and don't let it fully ever initialize.
>
> "A TPM that stops responding fails" is not very locked in scenario.
I cam update the commit. What about something like:
Some TPMs stop responding at runtime, hours to months after they
passed probe. The first sign is usually "invalid TPM_STS.x 0xff",
and from then on every command fails only after the transport
timeout. A TPM that is already dead at boot fails tpm2_probe() and
never registers, which is not affected by this patchset/feature.
Thanks,
--breno
next prev parent reply other threads:[~2026-11-13 15:14 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-13 10:38 [PATCH v3 0/2] tpm: Stop retrying TPMs that have stopped working Breno Leitao
2026-11-13 10:38 ` [PATCH v3 1/2] tpm: Disable a TPM that stops responding Breno Leitao
2026-11-13 14:42 ` Jarkko Sakkinen
2026-11-13 15:14 ` Breno Leitao [this message]
2026-11-13 10:38 ` [PATCH v3 2/2] tpm: Disable TPM on TPM_RC_INITIALIZE Breno Leitao
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=avconeIiDzMIq40n@gmail.com \
--to=leitao@debian.org \
--cc=corbet@lwn.net \
--cc=jarkko@kernel.org \
--cc=jgg@ziepe.ca \
--cc=kernel-team@meta.com \
--cc=linux-doc@vger.kernel.org \
--cc=linux-integrity@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=noodles@meta.com \
--cc=peterhuewe@gmx.de \
--cc=rdunlap@infradead.org \
--cc=skhan@linuxfoundation.org \
--cc=surenkj@amazon.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox