From: Surendran Kanagaraj <surenkj@amazon.com>
To: <jarkko@kernel.org>
Cc: <graf@amazon.de>, <gunnarku@amazon.com>, <jgg@ziepe.ca>,
<joshlev@amazon.com>, <linux-integrity@vger.kernel.org>,
<linux-kernel@vger.kernel.org>, <nh-open-source@amazon.com>,
<peterhuewe@gmx.de>, <surenkj@amazon.com>
Subject: Re: [PATCH 1/2] tpm: Add per-chip timeout for transient unavailability
Date: Tue, 29 Sep 2026 13:21:56 +0000 [thread overview]
Message-ID: <20260929132156.52496-1-surenkj@amazon.com> (raw)
In-Reply-To: <arabPv2YCddSMu_b@kernel.org>
On Fri, Sep 25, 2026, Jarkko Sakkinen wrote:
> On Wed, Sep 23, 2026 at 02:28:33PM +0000, Surendran Kanagaraj wrote:
> > + unsigned int busy_timeout_ms;
>
> So I think this is a wrong solution.
>
> Instead this should be tpm_crb internal and you should simply patch
> chip->duration[]. See tpm_tis_core for example.
Thanks for the review. Agreed that this belongs in tpm_crb.
TPM2 doesn't read chip->duration[] today. Commit 207696b17f38
("tpm: use a map for tpm2_calc_ordinal_duration()") removed the
ordinal to class lookup so patching the array would mean bringing
that back. Something like:
1. tpm2_get_timeouts() fills chip->duration[] with the TPM2 defaults
and calls ->update_durations() the same way tpm1_get_timeouts()
does. tpm_tis_update_durations() only handles 1.x, so I would make
it return early on TPM2.
2. For the command durations, bring back the class lookup, so
tpm2_calc_ordinal_duration() returns chip->duration[class] like
tpm1_calc_ordinal_duration() does. SELF_TEST (3000 ms) and
VERIFY_SIGNATURE (30000 ms) need special care since they don't
fit the old classes.
3. tpm_transmit() takes the TPM2_RC_RETRY cap from
chip->duration[TPM_LONG] instead of TPM2_DURATION_LONG.
tpm2_get_timeouts() sets it to TPM2_DURATION_LONG, so other chips
keep the same 2s.
4. tpm_crb implements ->update_durations() and raises the values to
30s for NitroTPM.
Does this match what you had in mind?
Thanks,
Surendran
next prev parent reply other threads:[~2026-09-29 13:22 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-23 14:28 [PATCH 0/2] tpm: Handle transient NitroTPM unavailability Surendran Kanagaraj
2026-09-23 14:28 ` [PATCH 1/2] tpm: Add per-chip timeout for transient unavailability Surendran Kanagaraj
2026-09-25 9:04 ` Breno Leitao
2026-09-28 19:50 ` Surendran Kanagaraj
2026-09-25 16:03 ` Jarkko Sakkinen
2026-09-29 13:21 ` Surendran Kanagaraj [this message]
2026-09-23 14:28 ` [PATCH 2/2] tpm_crb: Raise timeouts for Amazon NitroTPM Surendran Kanagaraj
2026-09-25 15:55 ` Jarkko Sakkinen
2026-09-28 21:09 ` Surendran Kanagaraj
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=20260929132156.52496-1-surenkj@amazon.com \
--to=surenkj@amazon.com \
--cc=graf@amazon.de \
--cc=gunnarku@amazon.com \
--cc=jarkko@kernel.org \
--cc=jgg@ziepe.ca \
--cc=joshlev@amazon.com \
--cc=linux-integrity@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nh-open-source@amazon.com \
--cc=peterhuewe@gmx.de \
/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
all inboxes | Powered by JetHome®