Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

tpm: fix (ACPI S3) suspend regression

This patch fixes an (ACPI S3) suspend regression introduced in commit
68d6e6713fcb ("tpm: Introduce function to poll for result of self test")
and occurring with an Infineon TPM and tpm_tis and tpm_infineon drivers
active.

The suspend problem occurred if the TPM was disabled and/or deactivated
and therefore the TPM_PCRRead checking the result of the (asynchronous)
self test returned an error code which then caused the tpm_tis driver to
become inactive and this then seemed to have negatively influenced the
suspend support by the tpm_infineon driver... Besides that the tpm_tis
drive may stay active even if the TPM is disabled and/or deactivated.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
Tested-by: Rafael J. Wysocki <rjw@sisk.pl>
Acked-by: Rajiv Andrade <srajiv@linux.vnet.ibm.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Stefan Berger and committed by
Linus Torvalds
be405411 93c3d65b

+12
+9
drivers/char/tpm/tpm.c
··· 846 846 847 847 do { 848 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 858 if (rc != TPM_WARN_DOING_SELFTEST) 850 859 return rc; 851 860 msleep(delay_msec);
+3
drivers/char/tpm/tpm.h
··· 39 39 }; 40 40 41 41 #define TPM_WARN_DOING_SELFTEST 0x802 42 + #define TPM_ERR_DEACTIVATED 0x6 43 + #define TPM_ERR_DISABLED 0x7 44 + 42 45 #define TPM_HEADER_SIZE 10 43 46 extern ssize_t tpm_show_pubek(struct device *, struct device_attribute *attr, 44 47 char *);