On Wed, Sep 23, 2026 at 02:28:33PM +0000, Surendran Kanagaraj wrote:
> Devices that have different timeout requirements than the TPM2 spec
Can you help us understand why this device doesn't follow the spec,
and why the quirk belongs in the kernel rather than being fixed in
the TPM2 itself?
Is NitroTPM a virtual TPM? If so, could the virtualization software
be fixed instead to follow the spec?
> @@ -241,6 +243,9 @@ ssize_t tpm_transmit(struct tpm_chip *chip, u8 *buf,
> size_t bufsiz)
> */
> memcpy(save, buf, save_size);
>
> + if (chip->busy_timeout_ms > max_delay_msec)
> + max_delay_msec = chip->busy_timeout_ms;
nit: this could use max() instead:
max_delay_msec = max(chip->busy_timeout_ms, max_delay_msec).
Also, should there be an upper bound?
> + if (duration < chip->busy_timeout_ms)
> + duration = chip->busy_timeout_ms;
>
> - return msecs_to_jiffies(TPM2_DURATION_DEFAULT);
> + return msecs_to_jiffies(duration);
What about something like this instead?
return msecs_to_jiffies(max_t(unsigned long, duration,
chip->busy_timeout_ms));
Thanks,
--breno