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

Reply via email to