mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jarkko Sakkinen <jarkko@kernel.org>
To: Surendran Kanagaraj <surenkj@amazon.com>
Cc: leitao@debian.org, 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
Subject: Re: [PATCH 1/2] tpm: Add per-chip timeout for transient unavailability
Date: Wed, 30 Sep 2026 01:15:25 +0300	[thread overview]
Message-ID: <arw4fd_uzHMFucTz@kernel.org> (raw)
In-Reply-To: <20260928195020.27969-1-surenkj@amazon.com>

On Mon, Sep 28, 2026 at 07:50:20PM +0000, Surendran Kanagaraj wrote:
> On Fri, Sep 25, 2026, Breno Leitao wrote:
> > 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?
> 
> Thanks for taking time to review my patches. Yes, its a vTPM. We are
> also working on shortening the window on our side but its really hard
> to keep it under the budget for all the cases. I also came across
> a similar implementation in tpm_crb_ffa which retries a busy TPM based
> on module param busy_timeout_ms. Should we adapt this param to crb in
> general?

Module parameter is generally a bad way to resolve anything. I don't
have knowledge actually why busy_timeout_ms needs to be a module in
tpm_crb_ffa and it is not possible to resolve busy_timeout_ms at
run-time.

I think tpm_crb driver should simply patch chip->duration table and
on TPM driver side we should start acquiring duration values by indexing
that table.

E.g., consider:

	unsigned int delay_msec = TPM2_DURATION_SHORT;

We want to instead:

	unsigned int delay_msec = chip->duration[TPM_SHORT];

I.e instead of adding new fields let's take better advantage of what we
have. I think this issue tells that duration table is underused and
these direct assignments from constants does not scale.

Br, Jarkko

  reply	other threads:[~2026-09-29 22:15 UTC|newest]

Thread overview: 11+ 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-29 22:15       ` Jarkko Sakkinen [this message]
2026-09-25 16:03   ` Jarkko Sakkinen
2026-09-29 13:21     ` Surendran Kanagaraj
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
2026-09-29 22:22       ` Jarkko Sakkinen

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=arw4fd_uzHMFucTz@kernel.org \
    --to=jarkko@kernel.org \
    --cc=graf@amazon.de \
    --cc=gunnarku@amazon.com \
    --cc=jgg@ziepe.ca \
    --cc=joshlev@amazon.com \
    --cc=leitao@debian.org \
    --cc=linux-integrity@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nh-open-source@amazon.com \
    --cc=peterhuewe@gmx.de \
    --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

all inboxes | Powered by JetHome®