security/tpm/tspi: Clear TPM state if resume fails

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 <tcrawford@system76.com>
This commit is contained in:
Tim Crawford
2023-06-15 15:45:25 -06:00
committed by Jeremy Soller
parent a7d1fea33b
commit 04e48d4932

View File

@@ -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;
}