Skip to content

Commit

Permalink
security/tpm/tspi: Clear TPM state if resume fails
Browse files Browse the repository at this point in the history
Per TPM spec and edk2 reference, perform a TPM restart in the case that
a TPM resume fails.

Change-Id: I444ab3cb12acbff740b5b8d2a9f7bed06392e9ec
Signed-off-by: Tim Crawford <[email protected]>
  • Loading branch information
crawfxrd authored and jackpot51 committed Jun 16, 2023
1 parent a7d1fea commit 04e48d4
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/security/tpm/tspi/tspi.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,10 @@ static uint32_t tpm_setup_s3_helper(void)

default:
printk(BIOS_ERR, "TPM: Resume failed (%#x).\n", result);
if (CONFIG(TPM2)) {
printk(BIOS_WARNING, "TPM: Clearing state\n");
result = tlcl_startup();
}
break;
}

Expand Down

0 comments on commit 04e48d4

Please sign in to comment.