diff options
Diffstat (limited to 'drivers/char/tpm/tpm.c')
-rw-r--r-- | drivers/char/tpm/tpm.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/drivers/char/tpm/tpm.c b/drivers/char/tpm/tpm.c index 023dfbaffe73..e38054b33bb4 100644 --- a/drivers/char/tpm/tpm.c +++ b/drivers/char/tpm/tpm.c | |||
@@ -843,7 +843,7 @@ int tpm_do_selftest(struct tpm_chip *chip) | |||
843 | { | 843 | { |
844 | int rc; | 844 | int rc; |
845 | unsigned int loops; | 845 | unsigned int loops; |
846 | unsigned int delay_msec = 1000; | 846 | unsigned int delay_msec = 100; |
847 | unsigned long duration; | 847 | unsigned long duration; |
848 | struct tpm_cmd_t cmd; | 848 | struct tpm_cmd_t cmd; |
849 | 849 | ||
@@ -864,6 +864,14 @@ int tpm_do_selftest(struct tpm_chip *chip) | |||
864 | cmd.header.in = pcrread_header; | 864 | cmd.header.in = pcrread_header; |
865 | cmd.params.pcrread_in.pcr_idx = cpu_to_be32(0); | 865 | cmd.params.pcrread_in.pcr_idx = cpu_to_be32(0); |
866 | rc = tpm_transmit(chip, (u8 *) &cmd, READ_PCR_RESULT_SIZE); | 866 | rc = tpm_transmit(chip, (u8 *) &cmd, READ_PCR_RESULT_SIZE); |
867 | /* Some buggy TPMs will not respond to tpm_tis_ready() for | ||
868 | * around 300ms while the self test is ongoing, keep trying | ||
869 | * until the self test duration expires. */ | ||
870 | if (rc == -ETIME) { | ||
871 | dev_info(chip->dev, HW_ERR "TPM command timed out during continue self test"); | ||
872 | msleep(delay_msec); | ||
873 | continue; | ||
874 | } | ||
867 | 875 | ||
868 | if (rc < TPM_HEADER_SIZE) | 876 | if (rc < TPM_HEADER_SIZE) |
869 | return -EFAULT; | 877 | return -EFAULT; |