* [PATCH] tpm2-cmd: try full selftest once if continue selftest failed
@ 2017-12-22 13:56 Alexander Steffen
2018-01-18 18:46 ` Jarkko Sakkinen
0 siblings, 1 reply; 2+ messages in thread
From: Alexander Steffen @ 2017-12-22 13:56 UTC (permalink / raw)
To: pmenzel, jgg, jarkko.sakkinen, linux-integrity; +Cc: Alexander Steffen
If the usual approach of triggering only the missing selftests failed, give
the TPM another chance by requesting all selftests once.
With the current implementation, this will only help for TPMs that then
choose to run the selftests synchronously and return the selftest result.
There is no retry loop that again polls a TPM returning TPM_RC_TESTING in
this case.
Signed-off-by: Alexander Steffen <Alexander.Steffen@infineon.com>
---
Patch depends on https://patchwork.kernel.org/patch/10105483/
drivers/char/tpm/tpm2-cmd.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/drivers/char/tpm/tpm2-cmd.c b/drivers/char/tpm/tpm2-cmd.c
index c17e753..b5c34d8 100644
--- a/drivers/char/tpm/tpm2-cmd.c
+++ b/drivers/char/tpm/tpm2-cmd.c
@@ -871,6 +871,14 @@ static int tpm2_do_selftest(struct tpm_chip *chip)
tpm_msleep(delay_msec);
}
+ if (rc != TPM2_RC_SUCCESS) {
+ cmd.header.in = tpm2_selftest_header;
+ cmd.params.selftest_in.full_test = 1;
+
+ rc = tpm_transmit_cmd(chip, NULL, &cmd, TPM2_SELF_TEST_IN_SIZE,
+ 0, 0, "full selftest");
+ }
+
return rc;
}
--
2.7.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-01-18 18:46 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-12-22 13:56 [PATCH] tpm2-cmd: try full selftest once if continue selftest failed Alexander Steffen
2018-01-18 18:46 ` Jarkko Sakkinen
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.