aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/char/tpm/tpm.c9
-rw-r--r--drivers/char/tpm/tpm.h3
2 files changed, 12 insertions, 0 deletions
diff --git a/drivers/char/tpm/tpm.c b/drivers/char/tpm/tpm.c
index 6a8771f47a55..32362cf35b8d 100644
--- a/drivers/char/tpm/tpm.c
+++ b/drivers/char/tpm/tpm.c
@@ -846,6 +846,15 @@ int tpm_do_selftest(struct tpm_chip *chip)
846 846
847 do { 847 do {
848 rc = __tpm_pcr_read(chip, 0, digest); 848 rc = __tpm_pcr_read(chip, 0, digest);
849 if (rc == TPM_ERR_DISABLED || rc == TPM_ERR_DEACTIVATED) {
850 dev_info(chip->dev,
851 "TPM is disabled/deactivated (0x%X)\n", rc);
852 /* TPM is disabled and/or deactivated; driver can
853 * proceed and TPM does handle commands for
854 * suspend/resume correctly
855 */
856 return 0;
857 }
849 if (rc != TPM_WARN_DOING_SELFTEST) 858 if (rc != TPM_WARN_DOING_SELFTEST)
850 return rc; 859 return rc;
851 msleep(delay_msec); 860 msleep(delay_msec);
diff --git a/drivers/char/tpm/tpm.h b/drivers/char/tpm/tpm.h
index 8c1df302fbb6..010547138281 100644
--- a/drivers/char/tpm/tpm.h
+++ b/drivers/char/tpm/tpm.h
@@ -39,6 +39,9 @@ enum tpm_addr {
39}; 39};
40 40
41#define TPM_WARN_DOING_SELFTEST 0x802 41#define TPM_WARN_DOING_SELFTEST 0x802
42#define TPM_ERR_DEACTIVATED 0x6
43#define TPM_ERR_DISABLED 0x7
44
42#define TPM_HEADER_SIZE 10 45#define TPM_HEADER_SIZE 10
43extern ssize_t tpm_show_pubek(struct device *, struct device_attribute *attr, 46extern ssize_t tpm_show_pubek(struct device *, struct device_attribute *attr,
44 char *); 47 char *);