* [PATCH v1] tpm: restore timeout for key creation commands
@ 2026-04-10 1:49 Baoli.Zhang
2026-04-10 6:49 ` Paul Menzel
0 siblings, 1 reply; 2+ messages in thread
From: Baoli.Zhang @ 2026-04-10 1:49 UTC (permalink / raw)
To: Peter Huewe, Jarkko Sakkinen, Jason Gunthorpe, Serge Hallyn
Cc: Baoli.Zhang, lili . li, linux-integrity, linux-kernel
After the per-command duration map was introduced, TPM2 key creation
commands (`CREATE_PRIMARY`, `CREATE`, `CREATE_LOADED`) were limited to
30 seconds.
On some platforms this is not sufficient and key creation can time out.
Commit 207696b17f38 ("tpm: use a map for tpm2_calc_ordinal_duration()")
inadvertently reduced these command timeouts from 300 seconds to 30
seconds. Restore them to 300 seconds to avoid spurious failures.
Fixes: 207696b17f38 ("tpm: use a map for tpm2_calc_ordinal_duration()")
Signed-off-by: Baoli.Zhang <baoli.zhang@linux.intel.com>
Co-developed-by: lili.li <lili.li@intel.com>
---
drivers/char/tpm/tpm2-cmd.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/char/tpm/tpm2-cmd.c b/drivers/char/tpm/tpm2-cmd.c
index 3a77be7ebf4aa..430022f695f24 100644
--- a/drivers/char/tpm/tpm2-cmd.c
+++ b/drivers/char/tpm/tpm2-cmd.c
@@ -71,9 +71,9 @@ static const struct {
{TPM2_CC_HIERARCHY_CHANGE_AUTH, 2000},
{TPM2_CC_GET_CAPABILITY, 750},
{TPM2_CC_NV_READ, 2000},
- {TPM2_CC_CREATE_PRIMARY, 30000},
- {TPM2_CC_CREATE, 30000},
- {TPM2_CC_CREATE_LOADED, 30000},
+ {TPM2_CC_CREATE_PRIMARY, 300000},
+ {TPM2_CC_CREATE, 300000},
+ {TPM2_CC_CREATE_LOADED, 300000},
};
/**
--
2.43.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH v1] tpm: restore timeout for key creation commands
2026-04-10 1:49 [PATCH v1] tpm: restore timeout for key creation commands Baoli.Zhang
@ 2026-04-10 6:49 ` Paul Menzel
0 siblings, 0 replies; 2+ messages in thread
From: Paul Menzel @ 2026-04-10 6:49 UTC (permalink / raw)
To: Baoli Zhang
Cc: Peter Huewe, Jarkko Sakkinen, Jason Gunthorpe, Serge Hallyn,
Lili Li, linux-integrity, linux-kernel
Dear Baoli,
Thank you for your patch. Some formalities:
Am 10.04.26 um 03:49 schrieb Baoli.Zhang:
> After the per-command duration map was introduced, TPM2 key creation
> commands (`CREATE_PRIMARY`, `CREATE`, `CREATE_LOADED`) were limited to
> 30 seconds.
>
> On some platforms this is not sufficient and key creation can time out.
> Commit 207696b17f38 ("tpm: use a map for tpm2_calc_ordinal_duration()")
> inadvertently reduced these command timeouts from 300 seconds to 30
> seconds. Restore them to 300 seconds to avoid spurious failures.
Please document such a platform.
> Fixes: 207696b17f38 ("tpm: use a map for tpm2_calc_ordinal_duration()")
>
> Signed-off-by: Baoli.Zhang <baoli.zhang@linux.intel.com>
It’d be great if you remove the dot from your name:
git config --global user.name "Baoli Zhang"
> Co-developed-by: lili.li <lili.li@intel.com>
Same here. Maybe spell it Lili Li?
git commit --amend --author="BaoliZhang
<baoli.zhang@linux.intel.com>" -s
> ---
> drivers/char/tpm/tpm2-cmd.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/char/tpm/tpm2-cmd.c b/drivers/char/tpm/tpm2-cmd.c
> index 3a77be7ebf4aa..430022f695f24 100644
> --- a/drivers/char/tpm/tpm2-cmd.c
> +++ b/drivers/char/tpm/tpm2-cmd.c
> @@ -71,9 +71,9 @@ static const struct {
> {TPM2_CC_HIERARCHY_CHANGE_AUTH, 2000},
> {TPM2_CC_GET_CAPABILITY, 750},
> {TPM2_CC_NV_READ, 2000},
> - {TPM2_CC_CREATE_PRIMARY, 30000},
> - {TPM2_CC_CREATE, 30000},
> - {TPM2_CC_CREATE_LOADED, 30000},
> + {TPM2_CC_CREATE_PRIMARY, 300000},
> + {TPM2_CC_CREATE, 300000},
> + {TPM2_CC_CREATE_LOADED, 300000},
> };
>
> /**
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-04-10 6:50 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-10 1:49 [PATCH v1] tpm: restore timeout for key creation commands Baoli.Zhang
2026-04-10 6:49 ` Paul Menzel
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox