LKML Archive on
help / color / mirror / Atom feed
From: Borys Movchan <>
To: Jarkko Sakkinen <>,
	Borys Movchan <>
Cc: Peter Huewe <>, Jason Gunthorpe <>,
	kernel <>,
	"" <>
Subject: Re: [PATCH v3] tpm: Add Upgrade/Reduced mode support for TPM2 modules
Date: Fri, 6 Aug 2021 16:20:56 +0200	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <>

On 8/5/21 10:52 PM, Jarkko Sakkinen wrote:
> On Wed, Aug 04, 2021 at 06:21:31PM +0200, Borys Movchan wrote:
>> If something went wrong during the TPM firmware upgrade, like power
>> failure or the firmware image file get corrupted, the TPM might end
>> up in Upgrade or Failure mode upon the next start. The state is
>> persistent between the TPM power cycle/restart.
>> According to TPM specification:
>>  * If the TPM is in Upgrade mode, it will answer with TPM2_RC_UPGRADE
>>    to all commands except Field Upgrade related ones.
>>  * If the TPM is in Failure mode, it will allow performing TPM
>>    initialization but will not provide any crypto operations.
>>    Will happily respond to Field Upgrade calls.
>> The fix changes the behavior of the `tpm2_auto_startup` function, so
> In commit messages, you ought to use imperative form:
> "Change the behaviour of tpm2_auto_startup(), ..."
>> it tries to detect what mode TPM is running in. If the chip is in the
>> Upgrade or Failure mode, the function returns -EIO error code which
>> can be used later to adjust driver behavior later.
> *How* tpm2_auto_startup() detects the mode?
>> After `tpm_chip_register` calls `tpm2_auto_startup` it checks for the
> Please remove all these hyphens. They make the commit message a pain
> to read. E.g. instead write tpm_chip_register(). This is not Github.
>> error code. If the TPM is in Upgrade or Failure mode, set the
>> `limited_mode` flag. The calls to `tpm2_get_cc_attrs_tbl`,
>> `tpm_add_hwrng` and `tpm_get_pcr_allocation` will fail if the TPM is
>> in Failure or Upgrade mode, so use `limited_mode` flag to exclude
>> them from the module initialization sequence.
>> Signed-off-by: Borys Movchan <>
>> ---
>> Notes:
>>     Commit message updated
> v2:
> * Commit message updated.
> Notes would be something that had existed already in the first version.
> Here we want a simple change log.
> /Jarkko

Kind regards,


      reply	other threads:[~2021-08-06 14:18 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-04 16:21 Borys Movchan
2021-08-05 20:52 ` Jarkko Sakkinen
2021-08-06 14:20   ` Borys Movchan [this message]

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:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \ \ \ \ \
    --subject='Re: [PATCH v3] tpm: Add Upgrade/Reduced mode support for TPM2 modules' \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).