Joel Kitching has uploaded this change for review. ( https://review.coreboot.org/28748
Change subject: tpm/tpm_setup: fail on invalid result from tlcl_resume ......................................................................
tpm/tpm_setup: fail on invalid result from tlcl_resume
BUG=b:114018226 TEST=None
Change-Id: I8f5df2b0119d35e4000fe62bf1bba6ca07f925f3 Signed-off-by: Joel Kitching kitching@google.com --- M src/security/tpm/tspi/tspi.c 1 file changed, 17 insertions(+), 3 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/48/28748/1
diff --git a/src/security/tpm/tspi/tspi.c b/src/security/tpm/tspi/tspi.c index 950e930..7782943 100644 --- a/src/security/tpm/tspi/tspi.c +++ b/src/security/tpm/tspi/tspi.c @@ -100,10 +100,24 @@ /* Handle special init for S3 resume path */ if (s3flag) { result = tlcl_resume(); - if (result == TPM_E_INVALID_POSTINIT) - printk(BIOS_INFO, "TPM: Already initialized.\n"); + switch (result) { + case TPM_SUCCESS: + break;
- return TPM_SUCCESS; + case TPM_E_INVALID_POSTINIT: + /* + * We're on a platform where the TPM maintains power + * in S3, so it's already initialized. + */ + printk(BIOS_INFO, "TPM: Already initialized.\n"); + result = TPM_SUCCESS; + break; + + default: + printk(BIOS_ERR, "TPM: Resume failed.\n"); + break; + + goto out; }
result = tlcl_startup();