summaryrefslogtreecommitdiff
path: root/drivers/char/tpm
diff options
context:
space:
mode:
authorNayna Jain <nayna@linux.vnet.ibm.com>2017-10-17 16:32:32 -0400
committerJarkko Sakkinen <jarkko.sakkinen@linux.intel.com>2018-01-08 12:58:33 +0200
commit5ef924d9e2e81e55c6aec056449a269409e15f21 (patch)
tree77efe1a4d50e91a0f3bac78cdfad029efb73deed /drivers/char/tpm
parentcf151a9a44d52a63332e8e926234574fe5a5d784 (diff)
tpm: use tpm_msleep() value as max delay
Currently, tpm_msleep() uses delay_msec as the minimum value in usleep_range. However, that is the maximum time we want to wait. The function is modified to use the delay_msec as the maximum value, not the minimum value. After this change, performance on a TPM 1.2 with an 8 byte burstcount for 1000 extends improved from ~9sec to ~8sec. Fixes: 3b9af007869("tpm: replace msleep() with usleep_range() in TPM 1.2/ 2.0 generic drivers") Signed-off-by: Nayna Jain <nayna@linux.vnet.ibm.com> Acked-by: Mimi Zohar <zohar@linux.vnet.ibm.com> Tested-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com> Reviewed-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com> Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Diffstat (limited to 'drivers/char/tpm')
-rw-r--r--drivers/char/tpm/tpm.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/char/tpm/tpm.h b/drivers/char/tpm/tpm.h
index 0c6c4fd8b137..9d768d2abd24 100644
--- a/drivers/char/tpm/tpm.h
+++ b/drivers/char/tpm/tpm.h
@@ -515,8 +515,8 @@ int tpm_pm_resume(struct device *dev);
static inline void tpm_msleep(unsigned int delay_msec)
{
- usleep_range(delay_msec * 1000,
- (delay_msec * 1000) + TPM_TIMEOUT_RANGE_US);
+ usleep_range((delay_msec * 1000) - TPM_TIMEOUT_RANGE_US,
+ delay_msec * 1000);
};
struct tpm_chip *tpm_chip_find_get(int chip_num);