Commit 62bfdacb authored by Jason Gunthorpe's avatar Jason Gunthorpe Committed by Jarkko Sakkinen

tpm: Do not print an error message when doing TPM auto startup

This is a regression when this code was reworked and made the error
print unconditional. The original code deliberately suppressed printing
of the first error message so it could quietly sense
TPM_ERR_INVALID_POSTINIT.

Fixes: a502feb67b47 ("tpm: Clean up reading of timeout and duration capabilities")
Signed-off-by: default avatarJason Gunthorpe <jgunthorpe@obsidianresearch.com>
Reviewed-by: default avatarJarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Signed-off-by: default avatarJarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
parent 19b7bf51
...@@ -546,8 +546,7 @@ int tpm_get_timeouts(struct tpm_chip *chip) ...@@ -546,8 +546,7 @@ int tpm_get_timeouts(struct tpm_chip *chip)
return 0; return 0;
} }
rc = tpm_getcap(chip, TPM_CAP_PROP_TIS_TIMEOUT, &cap, rc = tpm_getcap(chip, TPM_CAP_PROP_TIS_TIMEOUT, &cap, NULL);
"attempting to determine the timeouts");
if (rc == TPM_ERR_INVALID_POSTINIT) { if (rc == TPM_ERR_INVALID_POSTINIT) {
/* The TPM is not started, we are the first to talk to it. /* The TPM is not started, we are the first to talk to it.
Execute a startup command. */ Execute a startup command. */
...@@ -558,8 +557,12 @@ int tpm_get_timeouts(struct tpm_chip *chip) ...@@ -558,8 +557,12 @@ int tpm_get_timeouts(struct tpm_chip *chip)
rc = tpm_getcap(chip, TPM_CAP_PROP_TIS_TIMEOUT, &cap, rc = tpm_getcap(chip, TPM_CAP_PROP_TIS_TIMEOUT, &cap,
"attempting to determine the timeouts"); "attempting to determine the timeouts");
} }
if (rc) if (rc) {
dev_err(&chip->dev,
"A TPM error (%zd) occurred attempting to determine the timeouts\n",
rc);
return rc; return rc;
}
old_timeout[0] = be32_to_cpu(cap.timeout.a); old_timeout[0] = be32_to_cpu(cap.timeout.a);
old_timeout[1] = be32_to_cpu(cap.timeout.b); old_timeout[1] = be32_to_cpu(cap.timeout.b);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment